예제 #1
0
        private void SetCurrentAppState(ComponentType appStateType)
        {
            Action onReady = () =>
            {
                _currentAppState = _appStates[appStateType];
                _currentAppState.StateChangeRequested += StateChangeRequestedHandler;
                _currentAppState.AppSize = _graphicsBase.ScreenBounds;

                _currentAppStateRenderer              = _appStateRenderers[appStateType];
                _currentAppStateRenderer.Component    = _currentAppState;
                _currentAppStateRenderer.GraphicsBase = _graphicsBase;

                _gestureRecognizer.CurrentAppState = _currentAppState;

                _currentAppState.OnTransitionTo();
            };

            if (_currentAppState != null)
            {
                _currentAppState.StateChangeRequested -= StateChangeRequestedHandler;
                _currentAppState.OnTransitionFrom(onReady);
            }
            else
            {
                onReady();
            }
        }
예제 #2
0
        private void SetCurrentAppState(ComponentType appStateType)
        {
            Action onReady = () =>
                {
                    _currentAppState = _appStates[appStateType];
                    _currentAppState.StateChangeRequested += StateChangeRequestedHandler;
                    _currentAppState.AppSize = _graphicsBase.ScreenBounds;

                    _currentAppStateRenderer = _appStateRenderers[appStateType];
                    _currentAppStateRenderer.Component = _currentAppState;
                    _currentAppStateRenderer.GraphicsBase = _graphicsBase;

                    _gestureRecognizer.CurrentAppState = _currentAppState;

                    _currentAppState.OnTransitionTo();
                };

            if (_currentAppState != null)
            {
                _currentAppState.StateChangeRequested -= StateChangeRequestedHandler;
                _currentAppState.OnTransitionFrom(onReady);
            }
            else
                onReady();
        }