private void OnRemoveCandiesPressed() { if (CandyCornManager.GetTotalCandyCorn() >= 5) { CandyCornManager.RemoveCandyCorn(ADDCANDIES); } }
// called by the TargetSelector once it has selected targets public void SetTargetedCombatants(GameObject[] targetedCombatants) { CandyCornManager.RemoveCandyCorn(CandyCornCost); Debug.Log($"Ability about to continue! Got {targetedCombatants.Length} {targetedCombatants.GetType()}"); TargetedCombatants = targetedCombatants; Debug.Log($"Should be targetting {TargetedCombatants[0].GetType()}"); if (TargetedCombatants[0].TryGetComponent(out EnemyCombatant e)) // Kinda heavy on performance, but I am not sure how to check the class without getting the component { FaceEnemyInCombat(); } ContinueAbilityAfterTargeting(); }