using System; using UnityEngine; namespace ET.Client { [FriendOf(typeof(OperaComponent))] public static class OperaComponentSystem { [ObjectSystem] public class OperaComponentAwakeSystem : AwakeSystem { protected override void Awake(OperaComponent self) { self.mapMask = LayerMask.GetMask("Map"); } } [ObjectSystem] public class OperaComponentUpdateSystem : UpdateSystem { protected override void Update(OperaComponent self) { self.Update(); } } public static void Update(this OperaComponent self) { if (Input.GetMouseButtonDown(1)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 1000, self.mapMask)) { self.ClickPoint = hit.point; self.frameClickMap.X = self.ClickPoint.x; self.frameClickMap.Y = self.ClickPoint.y; self.frameClickMap.Z = self.ClickPoint.z; self.ClientScene().GetComponent().Session.Send(self.frameClickMap); } } if (Input.GetKeyDown(KeyCode.R)) { CodeLoader.Instance.LoadHotfix(); Game.EventSystem.Load(); Log.Debug("hot reload success!"); } if (Input.GetKeyDown(KeyCode.T)) { C2M_TransferMap c2MTransferMap = new C2M_TransferMap(); self.ClientScene().GetComponent().Session.Call(c2MTransferMap).Coroutine(); } } } }