Exemple #1
0
    public void StopGame()
    {
        if (player != null)
        {
            Destroy(player);
        }

        //Check Delegate if isn't null
        if (GameHasBeenEnded != null)
        {
            GameHasBeenEnded();
        }

        worldEditor.enabled = true;
        worldEditor.MainCamera.GetComponent <SmoothCamera2D>().enabled = false;
        worldEditor.MainCamera.GetComponent <CameraOrbiting>().enabled = true;
        worldEditor.Cursor.SetActive(true);
        StopButton.SetActive(false);
        GameUI.SetActive(false);
        PlayButton.SetActive(true);
        EditorUI.SetActive(true);
        worldEditor.LoadWorld(true);
        Fade.singleton.FadeOut(1f);
    }