Esempio n. 1
0
    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();
    }