void onTowerSelected(UnitTower unit) { print(unit.unitName + " selected"); UIAbilityButton.AlignButtonBegin(); List <Ability> abList = new List <Ability>(); foreach (UnitStat unitStat in unit.stats) { if (unitStat.abilityHolder) { Ability ability = unitStat.abilityHolder.ability; int id = ability.ID; foreach (Ability ab in abilityList) { if (ab.ID == id) { ab.abilityButton.rootObj.SetActive(true); } } } } UIAbilityButton.AlignButtonEnd(); //BuildAbilityButtons(abList); }
void OnFPSMode(bool flag) { //FPSModeCrosshairObj.SetActive(flag); #if UNITY_IPHONE || UNITY_ANDROID || UNITY_WP8 || UNITY_BLACKBERRY UIGameMessage.DisplayMessage("FPS mode is not supported in mobile"); #endif if (flag) { UIBuildButton.Hide(); UIAbilityButton.Hide(); UIPerkMenu.Hide(); UIFPSHUD.Show(); } else { if (UseDragNDrop()) { UIBuildButton.Show(); } if (AbilityManager.IsOn()) { UIAbilityButton.Show(); } if (PerkManager.IsOn()) { UIPerkMenu.Show(); } UIFPSHUD.Hide(); } }
void onTowerDeselected() { UIAbilityButton.AlignButtonBegin(); foreach (Ability ability in abilityList) { if (ability.belongToHero) { ability.abilityButton.rootObj.SetActive(false); } } UIAbilityButton.AlignButtonEnd(); }
void OnNewAbility(Ability newAbility) { Debug.Log("new abiility"); UIAbilityButton.AddNewAbility(newAbility); }
void Awake() { instance = this; thisObj = gameObject; }