public void BackButtonFunctionality(bool buttonPressed) { _combatManager = FindObjectOfType <CombatManager>(); // Toggle selected unit portraits off _combatManager._unitHudInfo.ToggleTargetedUnitsPortrait(false); // Remove all unit select images _combatManager.ClearUnitSelectImages(); //Destroy hit markers if (activeHitMarker) { DestroyActiveHitMarker(0); } // If the user pressed the 'back' button, give back mana to the user for the skill if (buttonPressed) { // Give mana back to relic for cancelling the skill StartCoroutine(_combatManager.activeUnit.UpdateCurMana(_combatManager.activeSkill.manaRequired, true)); } // Clear targets _combatManager.ClearTargets(); // Sets skill active as false _combatManager.activeAttackBar.UpdateActiveSkill(false); // Toggle to all skill panel _combatManager._unitHudInfo.ToggleToAllSkillsPanel(); }
public void ExitSkillDetailsButton() { // Remove skill detail panel, display all skill panel ExitSkillDetailPanel(); // Remove all unit select images _combatManager.ClearUnitSelectImages(); }
public void ToggleSelectionImage(bool ifTargetIsMultiple) { // If unit is able to be targetable and a skill is active if (targetable && _combatManager.activeSkill) { // Clear unit select images _combatManager.ClearUnitSelectImages(); // Add target to the selected targets _combatManager.AddTarget(unit); // If active skill target type is multiple if (ifTargetIsMultiple) { // Add all other enemies to the selected targets if (_combatManager.activeSkill.targetType == "Multiple") { if (_combatManager.activeUnit.unitType == Unit.UnitType.ALLY) { for (int i = 0; i < _combatManager._enemies.Count; i++) { _combatManager._enemies[i].target.ToggleSelectionImage(false); } } } } // Update Unit's mana for skill cost StartCoroutine(_combatManager.activeUnit.UpdateCurMana(_combatManager.activeSkill.manaRequired, false)); // Toggle off selected skill image _combatManager._unitHudInfo.ToggleSkillSelectionImage(_combatManager.activeSkill, false); // Prepare attack bar opening sequence StartCoroutine(_combatManager.activeAttackBar.PrepareAttackBarOpen()); } }