Ejemplo n.º 1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.GetComponent <PlayerPathMover>() != null && canKill == true)
     {
         Debug.Log("Collided With Player");
         AudioSingleton.PlaySFX(SoundEffect.LifeLost);
         if (PlayerLives.Lives > 1)
         {
             Score.score -= 30;
             StartCoroutine(DownPlayer(collision.gameObject));
             //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
         }
         else
         {
             PlayerLives.Lives = 3;
             SceneManager.LoadScene(10);
             AudioSingleton.PlayBGM(BackgroundMusic.MainMenu);
         }
     }
     if (collision.GetComponent <Ingredients>())
     {
         if (collision.GetComponent <Ingredients>().GetFalling() == true && canDie == true)
         {
             AudioSingleton.PlaySFX(SoundEffect.EnemySquished);
             Score.score += 20;
             Down();
         }
     }
 }
 private void StartStage(string stageName)
 {
     inGame   = true;
     IsPaused = false;
     SceneManager.LoadScene(stageName);
     AudioSingleton.PlayBGM(BackgroundMusic.Gameplay);
     pauseAnimator.SetBool("isPaused", false);
     titleAnimator.SetBool("isPaused", false);
     Time.timeScale = 1f;
     menuCanvas.GetComponent <GraphicRaycaster>().enabled = false;
     controlEventSystem.SetSelectedGameObject(null);
 }
Ejemplo n.º 3
0
 private void Start()
 {
     AudioSingleton.PlayBGM(BackgroundMusic.MainMenu);
 }