public void DebugChildrenLocalPositionAndLocalEuler() { children = U_Transform.GetSonS(transform); foreach (Transform child in children) { Debug.Log(child.name + " position " + child.localPosition + " euler " + child.localEulerAngles); } }
//获取组件 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); }
public static List <Transform> GetSonS(this Transform transform, bool isContainSelf = false) { return(U_Transform.GetSonS(transform, isContainSelf)); }