예제 #1
0
    public void SwapScene(string nextScene)
    {
        switch (SceneManager.GetActiveScene().name)
        {
        case "SampleScene":
            Data.AddPoints(playerInformation.GetScore());
            if (nextScene != null)
            {
                SceneManager.LoadScene(nextScene);
            }
            else
            {
                SceneManager.LoadScene("SaveScene");
            }
            break;

        case "SaveScene":
            if (nextScene != null)
            {
                SceneManager.LoadScene(nextScene);
            }
            else
            {
                SceneManager.LoadScene("SampleScene");
            }
            break;

        default:
            break;
        }
    }