コード例 #1
0
 void OnDestroy()
 {
     if (Actor.IsPlayer())
     {
         MsgSys.Remove <KeyCode>(GameEvent.KeyCodeEvt, OnKeyEvent);
     }
 }
コード例 #2
0
        void Start()
        {
            if (Actor.IsPlayer())
            {
                MsgSys.Add <KeyCode>(GameEvent.KeyCodeEvt, OnKeyEvent);
                CreateCastUI();
            }

            Actor.GetBuffCmpt().AddOnBuffAddListener(OnAddBuff);
            Actor.GetBuffCmpt().AddOnRemoveAddListener(OnRemoveBuff);
        }
コード例 #3
0
 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);
             }
         }
     }
 }