EnterMapHelper.cs 658 B

1234567891011121314151617181920212223
  1. using System;
  2. namespace ET.Client
  3. {
  4. public static partial class EnterMapHelper
  5. {
  6. public static async ETTask EnterMapAsync(Scene root)
  7. {
  8. try
  9. {
  10. G2C_EnterMap g2CEnterMap = await root.GetComponent<ClientSenderComponent>().Call(C2G_EnterMap.Create()) as G2C_EnterMap;
  11. // 等待场景切换完成
  12. await root.GetComponent<ObjectWait>().Wait<Wait_SceneChangeFinish>();
  13. EventSystem.Instance.Publish(root, new EnterMapFinish());
  14. }
  15. catch (Exception e)
  16. {
  17. Log.Error(e);
  18. }
  19. }
  20. }
  21. }