ShowMapComponent.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Threading.Tasks;
  4. using UnityEngine;
  5. using WS;
  6. public class ShowMapComponent : OperateComponent<ShowMapData>
  7. {
  8. /// <summary> 地图弹窗控制器 </summary>
  9. private MapController mapPop;
  10. public override void Init()
  11. {
  12. }
  13. public override void StartOperate()
  14. {
  15. mapPop = FacadeComponent.Instance.CreateController<MapController>();
  16. mapPop.OpenView();
  17. //mapPop.SetView(OperateData.sceneName,() =>
  18. //{
  19. // IsComplete = true;
  20. //});
  21. }
  22. public override Task StartState()
  23. {
  24. if (mapPop != null)
  25. {
  26. mapPop.CloseView();
  27. }
  28. return Task.CompletedTask;
  29. }
  30. public override Task EndState()
  31. {
  32. if (mapPop != null)
  33. {
  34. mapPop.CloseView();
  35. }
  36. return Task.CompletedTask;
  37. }
  38. public override void Update()
  39. {
  40. }
  41. }
  42. public class ShowMapData
  43. {
  44. /// <summary> 场景名称 </summary>
  45. public string sceneName;
  46. }