/// <summary> /// Reset the ball position and current drawn line then change the level /// </summary> protected virtual void OnTrackingFound() { BallReset reset = GameObject.FindGameObjectWithTag("Player").GetComponent <BallReset>(); lineReset.points.Clear(); reset.ResetBall(); levelChanger.ChangeLevel(); }
public void PlayerFoul() { if (liveBall == true) { GetComponent <AudioSource> ().Play(); BallScript.ResetBall(); CollectibleScript.ResetAllStars(); CollectibleScript2.ResetAllStars(); } }
void OnCollisionEnter(Collision col) { if (col.transform.name == "Ball" && gameLogic.ActiveCollectibles == 0) { GetComponent <AudioSource> ().Play(); BallScript.ResetBall(); CollectibleScript.ResetAllStars(); CollectibleScript2.ResetAllStars(); Winner = true; gameLogic.PlayerWon(); //Debug.Log("Goal!"); } else { Winner = false; } }