OperaComponentSystem.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using UnityEngine;
  2. namespace ET.Client
  3. {
  4. [FriendOf(typeof(OperaComponent))]
  5. public static class OperaComponentSystem
  6. {
  7. [ObjectSystem]
  8. public class OperaComponentAwakeSystem : AwakeSystem<OperaComponent>
  9. {
  10. protected override void Awake(OperaComponent self)
  11. {
  12. self.mapMask = LayerMask.GetMask("Map");
  13. }
  14. }
  15. [ObjectSystem]
  16. public class OperaComponentUpdateSystem : UpdateSystem<OperaComponent>
  17. {
  18. protected override void Update(OperaComponent self)
  19. {
  20. /*if (Input.GetMouseButtonDown(0))
  21. {
  22. Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
  23. RaycastHit hit;
  24. if (Physics.Raycast(ray, out hit, 1000, self.mapMask))
  25. {
  26. C2M_PathfindingResult c2MPathfindingResult = new C2M_PathfindingResult();
  27. c2MPathfindingResult.Position = hit.point;
  28. self.ClientScene().GetComponent<SessionComponent>().Session.Send(c2MPathfindingResult);
  29. }
  30. }*/
  31. if (Input.GetKeyDown(KeyCode.R))
  32. {
  33. CodeLoader.Instance.LoadHotfix();
  34. EventSystem.Instance.Load();
  35. Log.Debug("hot reload success!");
  36. }
  37. if (Input.GetKeyDown(KeyCode.T))
  38. {
  39. //C2M_TransferMap c2MTransferMap = new C2M_TransferMap();
  40. //self.ClientScene().GetComponent<SessionComponent>().Session.Call(c2MTransferMap).Coroutine();
  41. }
  42. }
  43. }
  44. }
  45. }