// routine per il calcolo del tempo public IEnumerator ritardoTempo(float myDelay) { duration = myDelay; min = Mathf.FloorToInt(duration / 60); sec = Mathf.FloorToInt(duration % 60); countDown.text = min.ToString("00") + ":" + sec.ToString("00"); countDownUI.text = countDown.text; while (duration > 0) { while (isPaused) { yield return(null); } yield return(new WaitForSeconds(1)); duration--; min = Mathf.FloorToInt(duration / 60); sec = Mathf.FloorToInt(duration % 60); countDown.text = min.ToString("00") + ":" + sec.ToString("00"); countDownUI.text = countDown.text; while (isPaused) { yield return(null); } } // if (SceneChanger.scene == 4) { message.text = " Tempo Scaduto." + "<br><br>Hai guadagnato " + buttonArrayCredit.credit + " punti"; } else { message.text = "Tempo Scaduto"; } fade.enableAuto(); //SceneManager.LoadScene(SceneManager.GetActiveScene().name); }
void OnParticleCollision(GameObject other) { int numCollisionEvents = part.GetCollisionEvents(other, collisionEvents); //Rigidbody rb = other.GetComponent<Rigidbody>(); int i = 0; while (i < numCollisionEvents) { //Debug.Log(i); if (other == player) { //SceneManager.LoadScene(SceneManager.GetActiveScene().name); fade.enableAuto(); Debug.Log("COLLISION!!!"); } else if (other == sword) { Debug.Log("KILL PARTICLE!!!!!"); particleDeath.Play(); } i++; } }