//基础初始化,例如兄弟个数等等 void Base_Init() { this.RemoveData(); this.brother = U_Transform.GetBrotherS(transform, false); this.groupCount = brother.Count; this.oriTrans_Obj = U_Transform.GetAddedStrTrans(transform, brother[brother.Count - 1], mark, markDigit, true); this.assembles_Obj = AddComponentCAS(oriTrans_Obj); }
//获取组件 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> GetBrotherS(this Transform transform, bool isContainSelf = false) { return(U_Transform.GetBrotherS(transform, isContainSelf)); }