Exemplo n.º 1
0
    void removeScene <T>()
        where T : SceneViewBase
    {
        T sc = getScene <T>();

        if (sc == null)
        {
            return;
        }
        sc.onDestroyed();
        scenes.Remove(sc);
        if (currentScene == sc)
        {
            currentScene = null;
        }
    }
Exemplo n.º 2
0
    T setNextScene <T>()
        where T : SceneViewBase, new()
    {
        T scene = getScene <T>();

        if (scene == null)
        {
            scene = createScene <T>();
        }
        else if (scene == currentScene)
        {
            return(scene);
        }

        if (currentScene != null)
        {
            currentScene.onExit();
        }
        currentScene = scene;
        currentScene.onEnter();

        return(scene);
    }