// Update is called once per frame void Update() { if ((playerHealth.currentHealth <= 0) && !looseTimeDisplayedBefore) { anim.SetTrigger("Lose"); displayTimeTakenAfterLosing.updateTimeText(guiTimer.getTimeInHMSFormat()); looseTimeDisplayedBefore = true; } }
private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Player")) { Debug.Log("Collided!"); displayTimeTakenText.updateTimeText("Time taken:" + guiTimer.getTimeInHMSFormat()); anim.SetTrigger("Win"); StartCoroutine(Wait()); //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); } }