You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
586 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;
class Utils
{
public static Transform findChildRecursive(Transform t, string name)
{
Transform transform = t.Find(name);
if (transform != null)
{
return transform;
}
for (int i = 0; i < t.childCount; i++)
{
transform = findChildRecursive(t.GetChild(i), name);
if (transform != null)
{
return transform;
}
}
return null;
}
}