예제 #1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        //checks the playerscript has been collided with
        Player playerScript = collision.collider.GetComponent <Player>();

        // something only happens when the play is hit
        if (playerScript != null)
        {
            // we DID hit the player !!!!!!

            // saves the seperate scores
            scoreObject.SaveTeaBag();

            SugarObject.SaveSugar();

            TeaBoxObject.SaveTeaBox();
            //goes to the high score screen
            SceneManager.LoadScene(sceneToLoad);
        }
    }