예제 #1
0
    void OpenScene(SceneBase scene)
    {
        Log("Open: " + scene);
        if (scene == null)
        {
            Log("Wrong Scene");
            return;
        }

        if (!scene.gameObject.activeSelf)
        {
            scene.gameObject.SetActive(true);
        }
        if (!scene.enabled)
        {
            scene.enabled = true;
        }

        scene.Initialization();          // シーンの初期化

        // EVENT / 遷移開始
        if (eventTransition != null)
        {
            eventTransition(scene, TransitionType.OPEN_START);
        }

        openTransitionScene = scene;         // 遷移中のシーン
        currentScene        = null;

        scene.eventOpenComplete += SceneOpenComplete;
        scene.OpenScene();
    }