public override void CheckEnemyDirection(Warrior enemy) { base.CheckEnemyDirection(enemy); if (Mathf.Round(Vector3.Dot(this.transform.forward, enemy.transform.forward)) == -1) { //plays the attack animation when the enemy is face to face with Swords Man SwordsManAnimationStates.getInstance().FaceToFaceEnemy(); enemyDamageSystem = SwordsManEnemyDetection.getInstance().currentEnemy.GetComponent <WarriorDamage>(); } }
void AttackDamage() { if (SwordsManEnemyDetection.getInstance().currentEnemy != null) { if (SwordsManEnemyDetection.getInstance().currentEnemy.status != WarriorStatus.Dead) { enemyDamageSystem.GotDamage(SwordsMan.getInstance().attackForce); } if (SwordsManEnemyDetection.getInstance().currentEnemy.status == WarriorStatus.Dead) { SwordsManAnimationStates.getInstance().NoTranslation(); SwordsMan.getInstance().nextDestination = SwordsManEnemyDetection.getInstance().currentEnemy.nextDestination; SwordsManEnemyDetection.getInstance().currentEnemy = null; } } }