Пример #1
0
 // Start is called before the first frame update
 public override void OnWindowEvent(Window.Event eventId)
 {
     if (eventId == Event.Create)
     {
         hero = mUserData as Player;
         EventMgr.single.AddListener("Game.Player", OnBindPlayer);
     }
     else if (eventId == Event.Destroy)
     {
         EventMgr.single.RemoveListener("Game.Player", OnBindPlayer);
     }
 }
Пример #2
0
 public override void OnWindowEvent(Window.Event eventId)
 {
     if (eventId == Event.Create)
     {
         EventMgr.single.AddListener(GRoot.EventResUnzip, OnResUnzipCallback);
         EventMgr.single.AddListener(GRoot.EventResUpdate, OnResUpdateCallback);
     }
     else if (eventId == Event.Destroy)
     {
         EventMgr.single.RemoveListener(GRoot.EventResUnzip, OnResUnzipCallback);
         EventMgr.single.RemoveListener(GRoot.EventResUpdate, OnResUpdateCallback);
     }
 }