Example #1
0
  void Die()
  {
      AudioSource.PlayClipAtPoint(playerDies, transform.position);
      Destroy(gameObject);
      LevelManagerScript levelMan = GameObject.Find("LevelManager").GetComponent <LevelManagerScript>();

      levelMan.LoadLevel("End");
  }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     if (loadLevel)
     {
         endImg.enabled = true;
         timer          = timer - Time.deltaTime;
         endImg.color  += new Color(endImgColor.r, endImgColor.g, endImgColor.b, .5f) * Time.deltaTime;
         if (timer <= 0f)
         {
             lms.LoadLevel("VictoryScreen");
         }
     }
     if (lost)
     {
         endImg.enabled = true;
         timer          = timer - Time.deltaTime;
         endImg.color  += new Color(endImgColor.r, endImgColor.g, endImgColor.b, .5f) * Time.deltaTime;
         if (timer <= 0f)
         {
             lms.LoadLevel("GameOverScreen");
         }
     }
 }
Example #3
0
 public void SaveAndExit()
 {
     PlayerPrefsManager.SetMasterVolume(volumeSlider.value);
     PlayerPrefsManager.SetDifficulty(difficultySlider.value);
     levelManager.LoadLevel("01a Start");
 }
Example #4
0
 private void OnTriggerEnter2D(Collider2D collider)
 {
     print("Trigger");
     levelManager.LoadLevel("Lose");
 }
 void OnTriggerEnter2D(Collider2D trigger)
 {
     level = GameObject.FindObjectOfType <LevelManagerScript>();
     level.LoadLevel("Lose");
 }
 void OnMouseDown()
 {
     levelManager.LoadLevel("01a Start");
 }
 void GameOver()
 {
     levelManager.LoadLevel("03b Lose");
 }