コード例 #1
0
        public void Start()
        {
            if (unitList != null && unitList.Count > 0)
            {
                for (int i = 0; i < unitList.Count; i++)
                {
                    unitList[i].myController = this;
                }
            }
            skillSlotHandler.myController  = this;
            leaderSlotHandler.myController = this;

            if (BattlefieldSceneManager.GetInstance != null && !BattlefieldSceneManager.GetInstance.isCampaignMode)
            {
                if (isAttacker)
                {
                    curColumnIdx = attackerColumnIdx;
                    curRowIdx    = attackerRowIdx;

                    SetPointBehavior();
                }
                else
                {
                    curColumnIdx = defenderColumnIdx;
                    curRowIdx    = defenderRowIdx;

                    SetPointBehavior();
                }

                unitList[0].SetAsSelected();
                selectedUnit = unitList[0];
            }

            skillSlotHandler.myPanel.PlayOpenAnimation();
        }
コード例 #2
0
        public void SetUnitPanelAsSelected(int idx)
        {
            selectedUnit       = unitList[idx];
            currentSelectedIdx = idx;

            for (int i = 0; i < unitList.Count; i++)
            {
                if (idx != i)
                {
                    unitList[i].UnSelect();
                }
                else
                {
                    unitList[idx].SetAsSelected();
                }
            }
        }
コード例 #3
0
        public void SetControlType(PlayerControlType curController, bool isAttacker)
        {
            controlType = curController;
            teamType    = (isAttacker) ? TeamType.Attacker : TeamType.Defender;
            BattlefieldUIHandler myHandler = BattlefieldSceneManager.GetInstance.battleUIInformation;

            if (controlType == PlayerControlType.Computer)
            {
                isComputer = true;
            }
            else
            {
                isComputer = false;
            }
            if (BattlefieldSceneManager.GetInstance != null && !BattlefieldSceneManager.GetInstance.isCampaignMode)
            {
                if (isAttacker)
                {
                    curColumnIdx = attackerColumnIdx;
                    curRowIdx    = attackerRowIdx;
                    SetPointBehavior();
                }
                else
                {
                    curColumnIdx = defenderColumnIdx;
                    curRowIdx    = defenderRowIdx;

                    SetPointBehavior();
                }


                unitList[0].SetAsSelected();
                selectedUnit = unitList[0];
            }

            skillSlotHandler.SetupSkillSlots();
        }