Beispiel #1
0
        private void doProcessClicked(RaycastHit raycastHit)
        {
            playerInfoBB.currClickedRaycastHit = raycastHit;

            //  点击的是地板
            if (raycastHit.collider.name == _gameConfigVo.playerMovementFloor)
            {
                sendFSMEvent(FSMEventsBlackBoard.FSM_JUST_MOVE);
            }
            else
            {
                Debug.Log(playerInfoBB.getCurrleadGo().name);
                Debug.Log(raycastHit.collider.gameObject.name);

                //  选择的是自己
                if (playerInfoBB.getCurrleadGo() == raycastHit.collider.gameObject)
                {
                    sendFSMEvent(FSMEventsBlackBoard.FSM_SELECT_SELF);
                }
                else
                {
                    //  选择了另一个可以控制的对象
                    PlayerUnitManager pum = raycastHit.collider.GetComponent <PlayerUnitManager>();
                    if (pum != null)
                    {
                        playerInfoBB.setCurrLeadGo(raycastHit.collider.gameObject);

                        sendFSMEvent(FSMEventsBlackBoard.FSM_LEAD_CHANGED);
                    }
                }



                //  点击的那个对象是否是 作战单位
                AIBattleUnit battleUnit = raycastHit.collider.gameObject.GetComponent <AIBattleUnit>();

                if (battleUnit != null)
                {
                    playerInfoBB.currSelectBattleUnit = battleUnit;
                }
            }
        }
Beispiel #2
0
 protected override void actionAwake()
 {
     _playerInfoBlackBoard       = SceneBlackBoard.getInstance().getBlackBoard <PlayerInfoBlackBoard>();
     _playerUnitManagerComponent = _playerInfoBlackBoard.getCurrleadGo().GetComponent <PlayerUnitManager>();
 }