Exemplo n.º 1
0
        private Promise ChangeCurrentController(ISceneController sceneController)
        {
            if (_currentSceneController == null)
            {
                Debug.Log(string.Format("NavController.ChangeCurrentController - SceneController={0}", sceneController));
                return(sceneController.Init()
                       .Then(x =>
                {
                    Debug.Log(string.Format("NavController.ChangeCurrentController - Init [Then] - Controller changed. sceneController={0}", sceneController));
                    _currentSceneController = sceneController;
                }));
            }

            return(Promise.All(_currentSceneController.Shutdown(), sceneController.Init())
                   .Then(x =>
            {
                Debug.Log(string.Format("NavController.ChangeCurrentController - All [Then] - Controller changed. sceneController={0}", sceneController));
                _currentSceneController = sceneController;
                return x;
            })
                   .Progress <string>(x => Debug.Log(string.Format("The progress status={0}", x))));
        }