private void OnTriggerEnter(Collider other) { if (other.gameObject.CompareTag("Interactable") && nextTarget.startMinigame == false) { ball.RespawnBall(); ball.Explode(); nextTarget.NextTarget(); nextTarget.startMinigame = true; trigger.TriggerMinigame(); } else if (other.gameObject.CompareTag("Interactable") && nextTarget.startMinigame == true) { ball.RespawnBall(); ball.Explode(); nextTarget.NextTarget(); nextTarget.score++; } }
private void Update() { if (inside == false) { timer -= Time.deltaTime; } if (timer <= 0.0f) { //Debug.Log("Time's up"); ball.RespawnBall(); } }