Пример #1
0
    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());
        }
    }
Пример #2
0
 public void ButtonInput_SelectTarget(HealthEntityCombatObject entity)
 {
     battleManager.AddTarget(entity, HideAllTargettingButtons);
 }