mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-09-20 14:21:55 +00:00
...
This commit is contained in:
parent
3813d5b0f4
commit
0e5399a896
1 changed files with 4 additions and 4 deletions
|
@ -286,14 +286,14 @@ namespace SanAndreasUnity.Utilities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Transform> GetFirstLevelChildrenPreallocated(this Transform tr)
|
public static Transform[] GetFirstLevelChildrenPreallocated(this Transform tr)
|
||||||
{
|
{
|
||||||
var list = new List<Transform>(tr.childCount);
|
var array = new Transform[tr.childCount];
|
||||||
for (int i = 0; i < tr.childCount; i++)
|
for (int i = 0; i < tr.childCount; i++)
|
||||||
{
|
{
|
||||||
list.Add(tr.GetChild(i));
|
array[i] = tr.GetChild(i);
|
||||||
}
|
}
|
||||||
return list;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<T> GetFirstLevelChildrenComponents<T>(this GameObject go) where T : Component
|
public static IEnumerable<T> GetFirstLevelChildrenComponents<T>(this GameObject go) where T : Component
|
||||||
|
|
Loading…
Reference in a new issue