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(); }
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(); } } }
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(); }