Ejemplo n.º 1
0
        private void Awake()
        {
            _instance = this;
            enabled   = false;

            QSBSceneManager.OnUniverseSceneLoaded += OnUniverseSceneLoad;
        }
Ejemplo n.º 2
0
        public void Awake()
        {
            Instance = this;
            enabled  = false;

            QSBSceneManager.OnUniverseSceneLoaded += OnUniverseSceneLoad;
        }
Ejemplo n.º 3
0
 private void StartPausing()
 {
     if (_state == State.Pausing)
     {
         return;
     }
     DebugLog.DebugWrite($"START PAUSING (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
     Locator.GetActiveCamera().enabled = false;
     OWTime.SetTimeScale(0f);
     _state = State.Pausing;
     SpinnerUI.Show();
     TimeSyncUI.Start(TimeSyncType.Pausing);
 }
        public void OnDisconnect()
        {
            OWTime.SetTimeScale(1f);
            OWTime.SetMaxDeltaTime(0.06666667f);
            OWTime.SetFixedTimestep(0.01666667f);
            Locator.GetActiveCamera().enabled = true;
            CurrentState  = State.NotLoaded;
            CurrentReason = null;

            Physics.SyncTransforms();
            SpinnerUI.Hide();
            TimeSyncUI.Stop();

            QSBInputManager.Instance.SetInputsEnabled(true);
        }
Ejemplo n.º 5
0
        private void ResetTimeScale()
        {
            OWTime.SetTimeScale(1f);
            OWTime.SetMaxDeltaTime(0.06666667f);
            OWTime.SetFixedTimestep(0.01666667f);
            Locator.GetActiveCamera().enabled = true;
            _state = State.Loaded;

            DebugLog.DebugWrite($"RESET TIMESCALE", MessageType.Info);
            _isFirstFastForward = false;
            QSBCore.HasWokenUp  = true;
            Physics.SyncTransforms();
            SpinnerUI.Hide();
            TimeSyncUI.Stop();
            QSBEventManager.FireEvent(EventNames.QSBPlayerStatesRequest);
            RespawnOnDeath.Instance.Init();
        }
Ejemplo n.º 6
0
 private void StartFastForwarding()
 {
     if (_state == State.FastForwarding)
     {
         TimeSyncUI.TargetTime = _serverTime;
         return;
     }
     DebugLog.DebugWrite($"START FASTFORWARD (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
     if (Locator.GetActiveCamera() != null)
     {
         Locator.GetActiveCamera().enabled = false;
     }
     _state = State.FastForwarding;
     OWTime.SetMaxDeltaTime(0.033333335f);
     OWTime.SetFixedTimestep(0.033333335f);
     TimeSyncUI.TargetTime = _serverTime;
     TimeSyncUI.Start(TimeSyncType.Fastforwarding);
 }
        private void StartPausing(PauseReason reason)
        {
            if (CurrentState == State.Pausing)
            {
                TimeSyncUI.TargetTime = _serverTime;
                return;
            }

            DebugLog.DebugWrite($"START PAUSING (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
            Locator.GetActiveCamera().enabled = false;

            //OWInput.ChangeInputMode(InputMode.None);
            QSBInputManager.Instance.SetInputsEnabled(false);

            OWTime.SetTimeScale(0f);
            CurrentState  = State.Pausing;
            CurrentReason = reason;
            SpinnerUI.Show();
            TimeSyncUI.TargetTime = _serverTime;
            TimeSyncUI.Start(TimeSyncType.Pausing, reason);
        }
        private void ResetTimeScale()
        {
            OWTime.SetTimeScale(1f);
            OWTime.SetMaxDeltaTime(0.06666667f);
            OWTime.SetFixedTimestep(0.01666667f);
            Locator.GetActiveCamera().enabled = true;
            CurrentState  = State.Loaded;
            CurrentReason = null;

            DebugLog.DebugWrite($"RESET TIMESCALE", MessageType.Info);
            Physics.SyncTransforms();
            SpinnerUI.Hide();
            TimeSyncUI.Stop();
            new RequestStateResyncMessage().Send();
            RespawnOnDeath.Instance.Init();

            QSBInputManager.Instance.SetInputsEnabled(true);

            if (!_hasWokenUp)
            {
                WakeUp();
            }
        }
        private void StartFastForwarding(FastForwardReason reason)
        {
            if (CurrentState == State.FastForwarding)
            {
                TimeSyncUI.TargetTime = _serverTime;
                return;
            }

            DebugLog.DebugWrite($"START FASTFORWARD (Target:{_serverTime} Current:{Time.timeSinceLevelLoad})", MessageType.Info);
            if (Locator.GetActiveCamera() != null)
            {
                Locator.GetActiveCamera().enabled = false;
            }

            //OWInput.ChangeInputMode(InputMode.None);
            QSBInputManager.Instance.SetInputsEnabled(false);

            CurrentState  = State.FastForwarding;
            CurrentReason = reason;
            OWTime.SetMaxDeltaTime(0.033333335f);
            OWTime.SetFixedTimestep(0.033333335f);
            TimeSyncUI.TargetTime = _serverTime;
            TimeSyncUI.Start(TimeSyncType.FastForwarding, reason);
        }