public void HandleEnemyHit(float damage) { enemy_.ChangeHealth((int)(-damage)); // TODO: Play hit sound enemy_.play("hit", true); enemy_.curr_behavior_ = EnemyCharacter.BehaviorType.HIT; if (enemy_.isDead) { // TODO: Show win screen player_won_ = true; enemy_.play("death"); FSoundManager.StopMusic(); FSoundManager.PlaySound("player_victory"); Debug.Log("You win!!"); } }
public void HandleEnemyHit(float damage) { enemy_.ChangeHealth((int)(-damage)); enemy_.play("hit", true); enemy_.curr_behavior_ = EnemyCharacter.BehaviorType.HIT; FSoundManager.PlaySound("enemy_hit"); if (enemy_.isDead) { finished_time = Time.time; player_won_ = true; enemy_.play("death"); FSoundManager.StopMusic(); FSoundManager.PlaySound("player_victory"); Debug.Log("You win!!"); } }