void OnDestroy() { if (Actor.IsPlayer()) { MsgSys.Remove <KeyCode>(GameEvent.KeyCodeEvt, OnKeyEvent); } }
void Start() { if (Actor.IsPlayer()) { MsgSys.Add <KeyCode>(GameEvent.KeyCodeEvt, OnKeyEvent); CreateCastUI(); } Actor.GetBuffCmpt().AddOnBuffAddListener(OnAddBuff); Actor.GetBuffCmpt().AddOnRemoveAddListener(OnRemoveBuff); }
void Update() { if (Input.GetMouseButtonDown(1)) { var ray = mMainCamera.Value.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (SystemPreset.IsGround(hit.transform.gameObject.tag)) { MsgSys.Send(GameEvent.ClickEnvGround, hit.point); } } } }