public void Attack() { EnemyCombat temp = GameObject.Find("Cube").GetComponent <EnemyCombat>(); if (currStamina > staminaActionMinimal) { currStamina -= attackStamina; stats.UpdateStaminaUI(currStamina); if (temp.GetState() == CombatStates.ATTACK) { temp.Damage(damage); } else { Damage(10.0f); } } SetState(CombatStates.NONE); }