コード例 #1
0
ファイル: GameFlow.cs プロジェクト: exclusiveor/CreatureMixer
 public SceneData(string name)
 {
     Menu                     = UIConsts.FORM_ID.NONE;
     Name                     = name;
     Forms                    = new List <FormData>();
     PreloadSceneName         = UIConsts.SCENE_ID.NONE;
     DesignResolutionWidth    = 0;
     DesignResolutionHeight   = 0;
     DesignMatchWidthOrHeight = 1; // by default match height
 }
コード例 #2
0
ファイル: GameFlow.cs プロジェクト: exclusiveor/CreatureMixer
    private IEnumerator PreloadSceneAsync(UIConsts.SCENE_ID sceneToPreload)
    {
        //AsyncOperation asyncOperation = Application.LoadLevelAsync(UIConsts.SCENE_NAMES[(int)sceneToPreload]);
        AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(UIConsts.SCENE_NAMES[(int)sceneToPreload]);

        asyncOperation.allowSceneActivation = false;
        _scenePreloadersOperations.Add(sceneToPreload, asyncOperation);

        yield return(asyncOperation);
        //Debug.Log("Preload done ____________________________");
    }
コード例 #3
0
    private IEnumerator PreloadSceneAsync(UIConsts.SCENE_ID sceneToPreload)
    {
        AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(UIConsts.SCENE_NAMES [(int)sceneToPreload]);

        asyncOperation.allowSceneActivation = false;
        EventData eventData = new EventData("OnAsyncSceneLoadEvent");

        eventData.Data.Add("asyncOperation", asyncOperation);
        GameManager.Instance.EventManager.CallOnAsyncSceneLoadEvent(eventData);
        _scenePreloadersOperations.Add(sceneToPreload, asyncOperation);
        yield return(asyncOperation);
        //Debug.Log ("Preload done ____________________________");
    }
コード例 #4
0
    public void TransitToScene(UIConsts.SCENE_ID nextScene)
    {
        if (_currentScene != UIConsts.SCENE_ID.SPLASHSCENE)
        {
            var fader = new FadeTransition()
            {
                fadeToColor = Color.black
            };
            TransitionKit.instance.transitionWithDelegate(fader);
        }

        GameManager.Instance.StartCoroutine(PreloadSceneAsync(nextScene));

        LeanTween.delayedCall(0.5f, () => TransitToSceneDelayed(nextScene));
    }
コード例 #5
0
    private void TransitToSceneDelayed(UIConsts.SCENE_ID nextScene)
    {
        _currentScene = nextScene;

        AsyncOperation preloadAsyncOperation;

        if (_scenePreloadersOperations.TryGetValue(nextScene, out preloadAsyncOperation))
        {
            preloadAsyncOperation.allowSceneActivation = true;
            _scenePreloadersOperations.Remove(nextScene);
        }
        else
        {
            _scenePreloadersOperations.Clear();
            //Debug.Log ("GameFlow: transiting to scene <" + nextScene + ">");
            SceneManager.LoadScene(UIConsts.SCENE_NAMES [(int)nextScene]);
        }
    }
コード例 #6
0
ファイル: GameFlow.cs プロジェクト: exclusiveor/CreatureMixer
    public void TransitToScene(UIConsts.SCENE_ID nextScene)
    {
        if (nextScene == UIConsts.SCENE_ID.MAINMENU || nextScene == UIConsts.SCENE_ID.SPLASH_SCENE)
        {
            FadeTransition.ExtraDelay = 0.7f;
        }
        else
        {
            FadeTransition.ExtraDelay = 0.1f;
        }
        if (_currentScene != UIConsts.SCENE_ID.STARTSCENE)
        {
            var fader = new FadeTransition()
            {
                fadeToColor = Color.black
            };
            TransitionKit.instance.transitionWithDelegate(fader);
        }

        LeanTween.delayedCall(0.5f, () => TransitToSceneDelayed(nextScene));
    }
コード例 #7
0
 public SceneData(string name)
 {
     Menu             = "";
     Name             = name;
     PreloadSceneName = UIConsts.SCENE_ID.NONE;
 }