EnterMapHelper.cs 868 B

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace ET.Client
  3. {
  4. public static class EnterMapHelper
  5. {
  6. public static async ETTask EnterMapAsync(Scene clientScene, string mapName)
  7. {
  8. try
  9. {
  10. var param = new C2G_EnterMap() { MapName = mapName };
  11. G2C_EnterMap g2CEnterMap = await clientScene.GetComponent<SessionComponent>().Session.Call(param) as G2C_EnterMap;
  12. clientScene.GetComponent<PlayerComponent>().MyId = g2CEnterMap.MyId;
  13. // 等待场景切换完成
  14. //await clientScene.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
  15. //EventSystem.Instance.Publish(clientScene, new EventType.EnterMapFinish());
  16. }
  17. catch (Exception e)
  18. {
  19. Log.Error(e);
  20. }
  21. }
  22. }
  23. }