mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Def load selection and basic def alteration
This commit is contained in:
parent
f78d85de3b
commit
0364322d46
311 changed files with 15823 additions and 1151 deletions
24
Assets/Scripts/Extensions/TransformExtensions.cs
Normal file
24
Assets/Scripts/Extensions/TransformExtensions.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public static class TransformExtensions
|
||||
{
|
||||
public static Transform FindDeepChild(this Transform parent, string childName)
|
||||
{
|
||||
Queue<Transform> queue = new Queue<Transform>();
|
||||
queue.Enqueue(parent);
|
||||
|
||||
while (queue.Count > 0)
|
||||
{
|
||||
var c = queue.Dequeue();
|
||||
if (c.name == childName)
|
||||
return c;
|
||||
foreach (Transform t in c)
|
||||
queue.Enqueue(t);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue