void OnCollisionEnter2D(Collision2D hit) { if (hit.gameObject.tag == "Killer") { theGameManager.RestartGame(); playerSpeed = playerSpeedStore; speedMilestoneCount = speedMilestoneCountStore; speedIncreaseMilestone = speedIncreaseMilestoneStore; DeathSound.Play(); } }
protected void onDeath(EventArgs args) { EventHandler handler = DeathEvent; if (handler != null) { handler(this, args); } if (DeathSound != null) { DeathSound.Play(); } ActiveAnimation = DeathAnimation; }