예제 #1
0
 public override void DeployParachutes()
 {
     if (!_drogueDeployed)
     {
         _drogueDeployed = true;
     }
     else if (!_parachuteDeployed)
     {
         _drogueDeployed    = false;
         _parachuteDeployed = true;
     }
     _parachute.Deploy();
 }
예제 #2
0
            private IEnumerator <WaitCommand> OnEnter(PlayingEnvironment environment)
            {
                _environment = environment;

                _parachute = _data.ImmersionSpawner.Create(environment.ParachuteConfig, "ImmersionParachute");
                _data.ParachuteController.Parachute = _parachute;

                _parachute.AttachToPilot(environment.Pilot, Parachute.InflightUnfoldOrientation, _data.GameSettingsProvider);
                // TODO This is a hack to compensate for the editor
                //      that misuses the pilot for its own purposes.
                //      We actually need a second pilot for editor purposes

                environment.Pilot.DisableWings();
                environment.Pilot.SetPhysical();
                environment.Pilot.PilotAnimator.SetState(PilotAnimatorState.Parachute);

                SwitchToMount(environment.SelectedCameraMount);
                _data.GameHud.SetTarget(_parachute.Pilot.FlightStatistics, AvatarType.Parachute);
                _data.GameHud.Activate();

                _parachute.Deploy();

                Cursor.lockState = CursorLockMode.Locked;
                Cursor.visible   = false;

                if (_data.CameraManager.Rig.Shake)
                {
                    _data.CameraManager.Rig.Shake.enabled = true;
                }

                _data.GameClock.Resume();
                _data.FixedClock.Resume();

                _data.SoundMixer.Unpause(SoundLayer.GameEffects);

                // Indicate that we have unfolded the parachute once, i.e. the player know how to do it
                if (_data.GameSettingsProvider.ActiveSettings.Tutorial.HasUnfoldedParachute != true)
                {
                    var gameSettings = _data.GameSettingsProvider.ActiveSettings;
                    gameSettings.Tutorial.HasUnfoldedParachute = true;
                    _data.GameSettingsProvider.UpdateGameSettings(gameSettings);
                }

                yield return(WaitCommand.DontWait);
            }