Exemplo n.º 1
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");
            }
        }
Exemplo n.º 2
0
        private void SpawnAt(SpawnPoint point)
        {
            var body = PlayerState.IsInsideShip() ? Locator.GetShipBody() : Locator.GetPlayerBody();

            body.WarpToPositionRotation(point.transform.position, point.transform.rotation);
            body.SetVelocity(point.GetPointVelocity());
            point.AddObjectToTriggerVolumes(Locator.GetPlayerDetector().gameObject);
            point.AddObjectToTriggerVolumes(_fluidDetector.gameObject);
            point.OnSpawnPlayer();
            OWTime.Unpause(OWTime.PauseType.Menu);

            if (_suitUpOnTravel)
            {
                Locator.GetPlayerSuit().SuitUp();
            }
        }
        private void OnCloseInfoPopup()
        {
            var pauseCommandListener = Locator.GetPauseCommandListener();

            if (pauseCommandListener != null && _addedPauseLock)
            {
                pauseCommandListener.RemovePauseCommandLock();
                _addedPauseLock = false;
            }

            OWTime.Unpause(OWTime.PauseType.Menu);
            OWInput.RestorePreviousInputs();

            PopupOK?.SafeInvoke();
            PopupOK = null;
        }
        public void EndConversation()
        {
            if (!enabled)
            {
                return;
            }

            enabled = false;
            if (_timeFrozen)
            {
                _timeFrozen = false;
                OWTime.Unpause(OWTime.PauseType.Reading);
            }

            _interactVolume.ResetInteraction();
            Locator.GetPlayerTransform().GetRequiredComponent <PlayerLockOnTargeting>().BreakLock();
            GlobalMessenger.FireEvent("ExitConversation");
            Locator.GetPlayerAudioController().PlayDialogueExit();
            if (_wasFlashlightOn && _turnOffFlashlight && _turnOnFlashlight)
            {
                Locator.GetFlashlight().TurnOn(false);
            }

            GameObject.FindWithTag("DialogueGui").GetRequiredComponent <DialogueBoxVer2>().OnEndDialogue();
            if (_currentNode != null)
            {
                _currentNode.SetNodeCompleted();
            }

            if (PlayerState.InZeroG())
            {
                var component = Locator.GetPlayerBody().GetComponent <Autopilot>();
                if (component.enabled)
                {
                    component.Abort();
                }
            }
        }