Example #1
0
 public static void OnRemove(this UIEventComponent self, UIComponent uiComponent, string uiType)
 {
     try
     {
         self.UIEvents[uiType].OnRemove(uiComponent);
     }
     catch (Exception e)
     {
         throw new Exception($"on remove ui error: {uiType}", e);
     }
 }
Example #2
0
 public static async ETTask <UI> OnCreate(this UIEventComponent self, UIComponent uiComponent, string uiType, UILayer uiLayer)
 {
     try
     {
         UI ui = await self.UIEvents[uiType].OnCreate(uiComponent, uiLayer);
         return(ui);
     }
     catch (Exception e)
     {
         throw new Exception($"on create ui error: {uiType}", e);
     }
 }
Example #3
0
 public static async ETTask <UI> OnCreate(this UIEventComponent self, UIComponent uiComponent, string uiType)
 {
     try
     {
         UI      ui      = await self.UIEvents[uiType].OnCreate(uiComponent);
         UILayer uiLayer = (ui.GameObject.GetComponent(typeof(UILayerScript)) as UILayerScript).UILayer;
         ui.GameObject.transform.SetParent(self.UILayers[(int)uiLayer]);
         return(ui);
     }
     catch (Exception e)
     {
         throw new Exception($"on create ui error: {uiType}", e);
     }
 }