Esempio n. 1
0
 public static Transform ActivatingComponent(this UITransform self)
 {
     if (self.transform == null)
     {
         var pui = self.Parent;
         self.transform = self.GetParentTransform()?.Find(UIManagerComponent.Instance.pathMap[pui.Id]);
         if (self.transform == null)
         {
             Log.Error(self.Parent.GetType().Name + "路径错误:" + UIManagerComponent.Instance.pathMap[pui.Id]);
         }
     }
     return(self.transform);
 }
Esempio n. 2
0
 public static Transform GetParentTransform(this UITransform self)
 {
     if (self.ParentTransform == null)
     {
         var pui     = self.Parent.Parent;
         var uitrans = pui.GetUIComponent <UITransform>("");
         if (uitrans == null)
         {
             Log.Error("ParentTransform is null Path:" + UIManagerComponent.Instance.pathMap[self.Id]);
         }
         else
         {
             uitrans.ActivatingComponent();
             self.ParentTransform = uitrans.transform;
         }
     }
     return(self.ParentTransform);
 }