MapHelper.cs 752 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace ET
  3. {
  4. public static class MapHelper
  5. {
  6. public static async ETVoid EnterMapAsync(Scene zoneScene, string sceneName)
  7. {
  8. try
  9. {
  10. G2C_EnterMap g2CEnterMap = await zoneScene.GetComponent<SessionComponent>().Session.Call(new C2G_EnterMap()) as G2C_EnterMap;
  11. UnitComponent unitComponent = zoneScene.GetComponent<UnitComponent>();
  12. unitComponent.MyUnit = unitComponent.Get(g2CEnterMap.UnitId);
  13. Game.EventSystem.Publish(new EventType.EnterMapFinish() {ZoneScene = zoneScene}).Coroutine();
  14. }
  15. catch (Exception e)
  16. {
  17. Log.Error(e);
  18. }
  19. }
  20. }
  21. }