// Update is called once per frame
 void Update()
 {
     //print(gameControllerScript.GetCheckpoints());
     GetComponent <TMP_Text>().text = string.Format("--Checkpoints--\n{0}", gameControllerScript.GetCheckpoints());
     if (Input.GetKeyDown(KeyCode.KeypadPlus) || Input.GetKeyDown(KeyCode.F5) || Input.GetButton("MENU") && Input.GetButtonDown("BLUE0"))
     {
         gameControllerScript.AddNewCheckpoint();
     }
 }
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (this.gameObject.tag == "Checkpoint" && collision.gameObject.tag == "Player")
     {
         gameControllerScript.AddNewCheckpoint();
         Destroy(this.gameObject);
     }
     if (this.gameObject.tag == "Bacteria" && collision.gameObject.tag == "Player")
     {
     }
 }
Exemple #3
0
 private void OnDestroy()
 {
     if (!isQuitting && gameControllerScript != null)
     {
         foreach (GameObject gameObject in gameObjectsToEnableOnDestroy)
         {
             gameObject.SetActive(true);
         }
         gameControllerScript.AddNewCheckpoint();
         gameControllerScript.uiStageProgression.SetActive(true);
     }
 }
 private void OnDestroy()
 {
     if (!isQuitting && gameControllerScript != null)
     {
         //foreach (GameObject gameObject in gameObjectsToEnableOnDestroy)
         //{
         //    gameObject.SetActive(true);
         //}
         gameControllerScript.AddNewCheckpoint();
         gameControllerScript.uiStageProgression.SetActive(false);
         gameControllerScript.IsFinal = true;
     }
 }