public void DamageEnemy1(float damageAmount, bool ignoreShield) { EnemyRPGAI controller = enemy1.GetComponent <EnemyRPGAI> (); controller.DamageEnemy(damageAmount, ignoreShield); if (_enemy1SlashAnimator) { _enemy1SlashAnimator.Play("RightSlash", 0, 0); } if (!enemy2 && controller.currentHealth <= 0 && !_didDestroyEnemy1) { _didDestroyEnemy1 = true; GlobalControl.Instance.UpdateEnemyStunAtIndex(GlobalControl.Instance.currentEnemyIndex); Debug.Log("Did destroy enemy"); playerController.canMove = false; playerController._didTriggerVictory = true; _audio.loop = false; _audio.Stop(); _audio.PlayOneShot(victoryClip); StartCoroutine(LoadLevel()); } }
public void DamageEnemy2(float damageAmount, bool ignoreShield) { EnemyRPGAI controller = enemy2.GetComponent <EnemyRPGAI> (); controller.DamageEnemy(damageAmount, ignoreShield); }