예제 #1
0
 public void SwitchTo3rdPerson()
 {
     if (!IsSetUp)
     {
         DebugLog.ToConsole("Warning - Camera not set up!", MessageType.Warning);
         OWInput.ChangeInputMode(InputMode.None);
         Mode = CameraMode.ThirdPerson;
         return;
     }
     if (Mode == CameraMode.ThirdPerson)
     {
         DebugLog.ToConsole("Warning - Already in 3rd person!", MessageType.Warning);
         return;
     }
     if (OWInput.GetInputMode() != InputMode.Character)
     {
         DebugLog.ToConsole("Warning - Cannot change to 3rd person while not in Character inputmode!", MessageType.Warning);
         return;
     }
     OWInput.ChangeInputMode(InputMode.None);
     QSBEventManager.FireEvent("SwitchActiveCamera", _owCamera);
     Locator.GetPlayerCamera().mainCamera.enabled = false;
     if (_cameraObj.GetComponent <PostProcessingBehaviour>() == null)
     {
         var postProcessing = _cameraObj.AddComponent <PostProcessingBehaviour>();
         postProcessing.profile = Locator.GetPlayerCamera().gameObject.GetComponent <PostProcessingBehaviour>().profile;
     }
     _camera.enabled = true;
     Mode            = CameraMode.ThirdPerson;
 }
예제 #2
0
        private void LateUpdate()
        {
            if (!_isOpenEyesSkipped && _isSolarSystemLoaded)
            {
                _isOpenEyesSkipped = true;

                // Skip wake up animation.
                var cameraEffectController = FindObjectOfType <PlayerCameraEffectController>();
                cameraEffectController.OpenEyes(0, true);
                cameraEffectController.SetValue("_wakeLength", 0f);
                cameraEffectController.SetValue("_waitForWakeInput", false);

                // Skip wake up prompt.
                LateInitializerManager.pauseOnInitialization = false;
                Locator.GetPauseCommandListener().RemovePauseCommandLock();
                Locator.GetPromptManager().RemoveScreenPrompt(cameraEffectController.GetValue <ScreenPrompt>("_wakePrompt"));
                OWTime.Unpause(OWTime.PauseType.Sleeping);
                cameraEffectController.Invoke("WakeUp");

                // Enable all inputs immedeately.
                OWInput.ChangeInputMode(InputMode.Character);
                typeof(OWInput).SetValue("_inputFadeFraction", 0f);
                GlobalMessenger.FireEvent("TakeFirstFlashbackSnapshot");
            }
        }
예제 #3
0
        private IEnumerator BeginRemoteUplinkSequence(Vector3 position, Quaternion rotation, float cameraDegrees)
        {
            HasStartedStatueLocally = true;
            var cameraEffectController = Locator.GetPlayerCamera().GetComponent <PlayerCameraEffectController>();

            cameraEffectController.CloseEyes(0.5f);
            OWInput.ChangeInputMode(InputMode.None);
            Locator.GetPauseCommandListener().AddPauseCommandLock();
            Locator.GetToolModeSwapper().UnequipTool();
            Locator.GetFlashlight().TurnOff(false);
            yield return(new WaitForSeconds(0.5f));

            // go to position
            QSBPlayerManager.HideAllPlayers();
            var timberHearth = Locator.GetAstroObject(AstroObject.Name.TimberHearth).GetAttachedOWRigidbody();

            Locator.GetPlayerBody().transform.position = timberHearth.transform.TransformPoint(position);
            Locator.GetPlayerBody().transform.rotation = timberHearth.transform.rotation * rotation;
            Locator.GetPlayerCamera().GetComponent <PlayerCameraController>().SetDegreesY(cameraDegrees);
            cameraEffectController.OpenEyes(1f, true);
            var uplinkTrigger = FindObjectOfType <MemoryUplinkTrigger>();

            uplinkTrigger.StartCoroutine("BeginUplinkSequence");
            yield break;
        }
 private void FixedUpdate()
 {
     if (this._enteringSim && Time.time > this._enterSimTime)
     {
         Locator.GetPlayerSuit().RemoveSuit(true);
         this._enteringSim = false;
         this._playerCamEffectController.OpenEyes(2f, false);
         this._insideSim     = true;
         this._localSleepPos = this._planetBody.transform.InverseTransformPoint(Locator.GetPlayerTransform().position);
         this._localSleepRot = Quaternion.Inverse(this._planetBody.transform.rotation) * Locator.GetPlayerTransform().rotation;
         Locator.GetFlashlight().TurnOff(false);
         Locator.GetPlayerBody().WarpToPositionRotation(this._entrySocket.position, this._entrySocket.rotation);
         Locator.GetPlayerBody().SetVelocity(this._simBody.GetPointVelocity(this._entrySocket.position));
         GlobalMessenger.FireEvent("EnterDreamWorld");
         OWInput.ChangeInputMode(InputMode.Character);
     }
     else if (this._exitingSim && Time.time > this._exitSimTime)
     {
         Locator.GetPlayerSuit().SuitUp(false, true);
         this._exitingSim = false;
         this._playerCamEffectController.OpenEyes(0.5f, false);
         this._insideSim = false;
         Locator.GetPlayerBody().WarpToPositionRotation(this._planetBody.transform.TransformPoint(this._localSleepPos), this._planetBody.transform.rotation * this._localSleepRot);
         Locator.GetPlayerBody().SetVelocity(this._planetBody.GetPointVelocity(this._planetBody.transform.TransformPoint(this._localSleepPos)));
         GlobalMessenger.FireEvent("ExitDreamWorld");
         OWInput.ChangeInputMode(InputMode.Character);
     }
 }
        protected override void OnEnter(PlayerInfo player)
        {
            if (TriggerOwner._state != CosmicInflationController.State.ReadyToCollapse)
            {
                return;
            }

            if (player.IsLocalPlayer)
            {
                AttachedObject.OnEntry -= OnEnterEvent;

                AttachedObject.SetTriggerActivation(false);
                TriggerOwner._probeDestroyTrigger.SetTriggerActivation(false);

                var repelVolume = (WhiteHoleFluidVolume)TriggerOwner._repelVolume;
                repelVolume._flowSpeed        = -repelVolume._flowSpeed;
                repelVolume._massiveFlowSpeed = -repelVolume._massiveFlowSpeed;
                repelVolume.SetVolumeActivation(true);
                QSBPlayerManager.HideAllPlayers();

                ReticleController.Hide();
                Locator.GetFlashlight().TurnOff(false);
                Locator.GetPromptManager().SetPromptsVisible(false);
                OWInput.ChangeInputMode(InputMode.None);
            }
            else
            {
                player.SetVisible(false, .3f);
            }

            if (Occupants.Count == QSBPlayerManager.PlayerList.Count)
            {
                StartCollapse();
            }
        }
        public void ExitSimulation()
        {
            if (this._enteringSim || this._exitingSim)
            {
                return;
            }

            OWInput.ChangeInputMode(InputMode.None);
            Locator.GetFlashlight().TurnOff(false);
            this._playerCamEffectController.CloseEyes(0.5f);
            this._exitingSim  = true;
            this._exitSimTime = Time.time + 0.5f + Time.deltaTime;
        }
        public void EnterSimulation()
        {
            if (this._enteringSim || this._exitingSim)
            {
                return;
            }

            OWInput.ChangeInputMode(InputMode.None);
            Locator.GetToolModeSwapper().UnequipTool();
            this._playerCamEffectController.CloseEyes(2f);
            this._enteringSim  = true;
            this._enterSimTime = Time.time + 2f + Time.deltaTime;
        }
        private void OpenInfoPopup(string message, string okButtonText, string cancelButtonText)
        {
            TwoButtonInfoPopup.SetUpPopup(message, InputLibrary.menuConfirm, InputLibrary.cancel, new ScreenPrompt(okButtonText), new ScreenPrompt(cancelButtonText));

            OWTime.Pause(OWTime.PauseType.Menu);
            OWInput.ChangeInputMode(InputMode.Menu);

            var pauseCommandListener = Locator.GetPauseCommandListener();

            if (pauseCommandListener != null)
            {
                pauseCommandListener.AddPauseCommandLock();
                _addedPauseLock = true;
            }

            TwoButtonInfoPopup.EnableMenu(true);
        }
예제 #9
0
 public void SwitchTo1stPerson()
 {
     if (!IsSetUp)
     {
         DebugLog.ToConsole("Warning - Camera not set up!", MessageType.Warning);
         OWInput.ChangeInputMode(InputMode.Character);
         Mode = CameraMode.FirstPerson;
         return;
     }
     if (Mode == CameraMode.FirstPerson)
     {
         DebugLog.ToConsole("Warning - Already in 1st person!", MessageType.Warning);
         return;
     }
     OWInput.ChangeInputMode(InputMode.Character);
     QSBEventManager.FireEvent("SwitchActiveCamera", Locator.GetPlayerCamera());
     Locator.GetActiveCamera().mainCamera.enabled = true;
     _camera.enabled = false;
     Mode            = CameraMode.FirstPerson;
 }
예제 #10
0
 private void EnableInput()
 {
     _isInputEnabled = true;
     OWInput.ChangeInputMode(InputMode.Character);
 }
예제 #11
0
 private void DisableInput()
 {
     _isInputEnabled = false;
     OWInput.ChangeInputMode(InputMode.None);
 }
예제 #12
0
        void Update()
        {
            if (inputEnabled)
            {
                if (Input.GetKeyDown(KeyCode.UpArrow))
                {
                    SetupCamera();
                }

                if (Input.GetKeyDown(KeyCode.LeftArrow))
                {
                    if (Locator.GetPlayerSuit().IsWearingHelmet())
                    {
                        Locator.GetPlayerSuit().RemoveHelmet();
                    }
                    else
                    {
                        Locator.GetPlayerSuit().PutOnHelmet();
                    }
                }

                if (Input.GetKeyDown(KeyCode.KeypadDivide))
                {
                    Time.timeScale = 0f;
                }

                if (Input.GetKeyDown(KeyCode.KeypadMultiply))
                {
                    Time.timeScale = 0.5f;
                }

                if (Input.GetKeyDown(KeyCode.KeypadMinus))
                {
                    Time.timeScale = 1f;
                }

                if (Input.GetKeyDown(KeyCode.Keypad0))
                {
                    _freeCam.transform.parent = Locator.GetPlayerTransform();
                }

                if (Input.GetKeyDown(KeyCode.Keypad1))
                {
                    _freeCam.transform.parent = Locator.GetSunTransform();
                }

                if (Input.GetKeyDown(KeyCode.Keypad2))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.Comet).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad3))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.CaveTwin).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad4))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.TowerTwin).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad5))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.TimberHearth).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad6))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.BrittleHollow).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad7))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.GiantsDeep).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad8))
                {
                    _freeCam.transform.parent = Locator.GetAstroObject(AstroObject.Name.DarkBramble).gameObject.transform;
                }

                if (Input.GetKeyDown(KeyCode.Keypad9))
                {
                    _freeCam.transform.position = Locator.GetPlayerTransform().position;
                }

                if (Input.GetKeyDown(KeyCode.KeypadPlus))
                {
                    _moveSpeed = 7f;
                }

                if (Input.GetKeyDown(KeyCode.KeypadEnter))
                {
                    _moveSpeed = 1000f;
                }

                if (Input.GetKeyDown(KeyCode.KeypadPeriod))
                {
                    if (mode)
                    {
                        mode = false;
                        if (_storedMode == InputMode.None)
                        {
                            _storedMode = InputMode.Character;
                        }
                        OWInput.ChangeInputMode(_storedMode);
                        GlobalMessenger <OWCamera> .FireEvent("SwitchActiveCamera", Locator.GetPlayerCamera());

                        _camera.enabled = false;
                        Locator.GetActiveCamera().mainCamera.enabled = true;
                    }
                    else
                    {
                        mode        = true;
                        _storedMode = OWInput.GetInputMode();
                        OWInput.ChangeInputMode(InputMode.None);
                        GlobalMessenger <OWCamera> .FireEvent("SwitchActiveCamera", _OWCamera);

                        Locator.GetActiveCamera().mainCamera.enabled = false;
                        _camera.enabled = true;
                    }
                }
            }
        }