public void ChangeChildrenTag() { foreach (Transform tran in U_Transform.GetChildren(transform, true)) { tran.tag = tarTag; } }
// 获得children的localEulerAngles public static List <Vector3> GetChildrenLocalEuler(Transform trans, bool containSelf = false) { List <Transform> children = U_Transform.GetChildren(trans, containSelf); List <Vector3> childrenLocalEuler = new List <Vector3>(); foreach (Transform t in children) { childrenLocalEuler.Add(trans.localEulerAngles); } return(childrenLocalEuler); }
//获取组件 public static List <T> GetTComponent <T>(Transform tran, WE_TransformRange transformRange = WE_TransformRange.Self) { List <T> tC = new List <T>(); switch (transformRange) { case WE_TransformRange.Self: tC.Add(tran.GetComponent <T>()); break; case WE_TransformRange.SelfSon: GetTC_FromTransforms <T>(U_Transform.GetSonS(tran, true)); break; case WE_TransformRange.SelfChildren: tC = GetTC_FromTransforms <T>(U_Transform.GetChildren(tran, true)); break; case WE_TransformRange.SelfBrother: tC = GetTC_FromTransforms <T>(U_Transform.GetBrotherS(tran, true)); break; case WE_TransformRange.Son: tC = GetTC_FromTransforms <T>(U_Transform.GetSonS(tran, false)); break; case WE_TransformRange.Children: GetTC_FromTransforms <T>(U_Transform.GetChildren(tran, false)); break; case WE_TransformRange.Brother: tC = GetTC_FromTransforms <T>(U_Transform.GetBrotherS(tran, false)); break; } return(tC); }
void GetChildren() { children = U_Transform.GetChildren(transform); }
public static List <Transform> GetChildren(this Transform transform, bool isContainSelf = false) { return(U_Transform.GetChildren(transform, isContainSelf)); }