quakeball/Assets/Scripts/Util/TransformUtil.cs
2020-08-10 00:50:59 +03:00

21 lines
583 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace NeonTea.Quakeball.Util {
public static class TransformUtil {
public static Transform FindChildWithName(Transform t, string name) {
if (t.name == name) {
return t;
}
for (int i = 0; i < t.childCount; i++) {
Transform child = FindChildWithName(t.GetChild(i), name);
if (child != null) {
return child;
}
}
return null;
}
}
}