//This function is called to reduce player HP and handle death public void DamagePlayer(int dmg) { if (mPlayerCharacter.InflictDamage(dmg)) { mCurrentDifficulty.Stop(); mGameOverTime = Time.timeSinceLevelLoad; mGameStatus = State.GameOver; GameText.text = string.Format("You Died!"); } }
// End the game. public void GameOver() { ShowNewHighScore(); mCurrentDifficulty.Stop(); mGameStatus = State.GameOver; }