示例#1
0
 void OnCollisionEnter2D(Collision2D hit)
 {
     if (hit.gameObject.tag == "Killer")
     {
         theGameManager.RestartGame();
         playerSpeed            = playerSpeedStore;
         speedMilestoneCount    = speedMilestoneCountStore;
         speedIncreaseMilestone = speedIncreaseMilestoneStore;
         DeathSound.Play();
     }
 }
示例#2
0
        protected void onDeath(EventArgs args)
        {
            EventHandler handler = DeathEvent;

            if (handler != null)
            {
                handler(this, args);
            }

            if (DeathSound != null)
            {
                DeathSound.Play();
            }
            ActiveAnimation = DeathAnimation;
        }