コード例 #1
0
        IEnumerator <WaitCommand> OnExit()
        {
            _closeListener.Dispose();
            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeOut(_data.CameraManager.Rig.ScreenFader, _data.Clock, _data.FaderSettings)));

            _data.CourseEditor.enabled = false;
        }
コード例 #2
0
 private IEnumerator <WaitCommand> ExitOldState()
 {
     _isTransitioning = true;
     while (_stack.Count > 0)
     {
         var state = _stack.Pop();
         UnsubscribeToStateMethods(state);
         yield return(WaitCommand.WaitRoutine(InvokeStateLifeCycleMethod(state.OnExit)));
     }
     _isTransitioning = false;
 }
コード例 #3
0
ファイル: Playing.cs プロジェクト: swipswaps/VoloAirsport
        IEnumerator <WaitCommand> OnExit()
        {
            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeOut(_data.CameraManager.Rig.ScreenFader, _data.MenuClock, _data.FaderSettings)));

            _playingStateMachine.Transition(PlayingStates.Initial);

            yield return(_data.PlayerPilotSpawner.Despawn().AsWaitCommand());

            _data.ChallengeAnnouncerUi.enabled        = false;
            _data.JoystickActivator.enabled           = true;
            _data.ThirdPersonCameraController.enabled = false;
        }
コード例 #4
0
ファイル: SpawnScreen.cs プロジェクト: swipswaps/VoloAirsport
        IEnumerator <WaitCommand> OnExit()
        {
            OnSuspend();

            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeOut(_data.CameraManager.Rig.ScreenFader, _data.MenuClock, _data.FaderSettings)));

            _data.CameraAnimator.enabled = false;
            var spawnpointBillboards = _uiState.To(s => s.SpawnpointUIList).To(s => s.Items).Get();

            for (int i = 0; i < spawnpointBillboards.Count; i++)
            {
                spawnpointBillboards[i].SetActive(false);
            }
        }
コード例 #5
0
        // When exiting always transition to spawnpoint selection
        // Allow options menu to be enabled

        IEnumerator <WaitCommand> OnEnter()
        {
            _data.CourseEditor.enabled = true;

            var currentCameraTransform = _data.CameraManager.Rig.transform.MakeImmutable();

            _data.Mount.transform.Set(currentCameraTransform);
            _data.CameraManager.SwitchMount(_data.Mount);

            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeIn(_data.CameraManager.Rig.ScreenFader, _data.Clock, _data.FaderSettings)));

            _closeListener = _data.CourseEditor.CloseEditor.Subscribe(_ => {
                Machine.Transition(VoloStateMachine.States.SpawnScreen);
            });
        }
コード例 #6
0
ファイル: SpawnScreen.cs プロジェクト: swipswaps/VoloAirsport
        IEnumerator <WaitCommand> OnEnter()
        {
            _data.CameraManager.SwitchMount(_data.CameraMount.GetComponent <ICameraMount>());

            var spawnpointBillboards = _uiState.To(s => s.SpawnpointUIList).To(s => s.Items).Get();

            for (int i = 0; i < _spawnpoints.Count; i++)
            {
                var spawnpoint = _spawnpoints[i];
                spawnpointBillboards[i].SetActive(spawnpoint.IsDiscovered);
            }

            OnResume();

            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeIn(_data.CameraManager.Rig.ScreenFader, _data.MenuClock, _data.FaderSettings)));
        }
コード例 #7
0
ファイル: Playing.cs プロジェクト: swipswaps/VoloAirsport
        IEnumerator <WaitCommand> OnEnter(SpawnpointLocation spawnpoint)
        {
            _data.ChallengeAnnouncerUi.enabled        = true;
            _data.JoystickActivator.enabled           = false;
            _data.ThirdPersonCameraController.enabled = true;

            // TODO Don't spawn the player this is now the responsisiblity of the wingsuit state
            //yield return _data.PlayerPilotSpawner.Respawn(spawnpoint).AsWaitCommand();

            var environment = new PlayingEnvironment(
                spawnpoint: spawnpoint,
                pilot: null,
                parachuteConfig: _activeParachuteConfig.Get());

            _playingStateMachine.Transition(PlayingStates.FlyingWingsuit, environment, Maybe.Just(new RespawnRequest()));
            yield return(WaitCommand.WaitRoutine(CameraTransitions.FadeIn(_data.CameraManager.Rig.ScreenFader, _data.MenuClock, _data.FaderSettings)));
        }
コード例 #8
0
        private IEnumerator <WaitCommand> InvokeStateLifeCycleMethod(Delegate del, params object[] args)
        {
            WaitCommand waitCommand = WaitCommand.DontWait;

            if (del != null)
            {
                try {
                    if (del.Method.ReturnType == typeof(IEnumerator <WaitCommand>))
                    {
                        waitCommand = WaitCommand.WaitRoutine((IEnumerator <WaitCommand>)del.DynamicInvoke(args));
                    }
                    else
                    {
                        del.DynamicInvoke(args);
                    }
                } catch (TargetParameterCountException e) {
                    throw new ArgumentException(GetArgumentExceptionDetails((State)del.Target, del, args), e);
                }
            }
            yield return(waitCommand);
        }
コード例 #9
0
        private IEnumerator <WaitCommand> Transition(StateInstance newState, object[] enterParams)
        {
            yield return(WaitCommand.WaitRoutine(ExitOldState()));

            yield return(WaitCommand.WaitRoutine(EnterNewState(newState, enterParams)));
        }