public void Pause() { switch (CurrentState.CurrentPhase) { case TimerPhase.Running: var realTime = CurrentState.CurrentTime.RealTime; if (realTime == null) { break; } CurrentState.TimePausedAt = realTime.Value; CurrentState.CurrentPhase = TimerPhase.Paused; OnPause?.Invoke(this, null); break; case TimerPhase.Paused: CurrentState.AdjustedStartTime = TimeStamp.Now - CurrentState.TimePausedAt; CurrentState.CurrentPhase = TimerPhase.Running; OnResume?.Invoke(this, null); break; case TimerPhase.NotRunning: Start(); break; case TimerPhase.Ended: break; default: throw new ArgumentOutOfRangeException(); } }
public void Pause(OnResume _onResume) { onResume = _onResume; //Enable Cursor Cursor.visible = true; Cursor.lockState = CursorLockMode.Confined; gameObject.SetActive(true); }
/// <summary> /// 恢复执行 /// </summary> public void Resume() { switchTimer(); if (OnResume != null) { OnResume.BeginInvoke(this, null, null, null); } }
private MediaRecorder(IJSRuntime jsRuntime, JsObjectRef jsObjectRef, IMediaStream stream, MediaRecorderOptions options) : base(jsRuntime, jsObjectRef) { AddNativeEventListenerForObjectRef("dataavailable", (s, e) => OnDataAvailable?.Invoke(s, e), BlobEvent.Create); AddNativeEventListenerForObjectRef("error", (s, e) => OnError?.Invoke(s, e), DOMException.Create); AddNativeEventListener("pause", (s, e) => OnPause?.Invoke(s, e)); AddNativeEventListener("resume", (s, e) => OnResume?.Invoke(s, e)); AddNativeEventListener("start", (s, e) => OnStart?.Invoke(s, e)); AddNativeEventListener("stop", (s, e) => OnStop?.Invoke(s, e)); }
public void GameResume() { Paused = false; foreach (var component in components.ToArray()) { component.GameResume(); } if (OnResume != null) { OnResume.Invoke(); } }
private void HandleApprovalStateChangedEvent(ApprovalStateChangedEvent evt) { switch (evt.Entity.CurrentState) { case Approval.StateEnum.ACTIVE: OnResume?.Invoke(); break; case Approval.StateEnum.PAUSED: OnPause?.Invoke(); break; } }
private void HandleApprovalStatusChangedEvent(ApprovalStatusChangedEvent evt) { switch (evt.Entity.Status) { case Approval.StatusEnum.APPROVED: OnResume?.Invoke(); break; case Approval.StatusEnum.REJECTED: OnRevoke?.Invoke(); socket.CloseConnection(); break; } }
public void Bind(string luaName) { LuaOnInit = GameMode.XLua.GetInPath <OnInit>($"{luaName}.OnInit"); LuaOnFree = GameMode.XLua.GetInPath <OnFree>($"{luaName}.OnFree"); LuaOnUpdate = GameMode.XLua.GetInPath <OnUpdate>($"{luaName}.OnUpdate"); LuaOnEnter = GameMode.XLua.GetInPath <OnEnter>($"{luaName}.OnEnter"); LuaOnExit = GameMode.XLua.GetInPath <OnExit>($"{luaName}.OnExit"); LuaPause = GameMode.XLua.GetInPath <OnPause>($"{luaName}.OnPause"); LuaOnResume = GameMode.XLua.GetInPath <OnResume>($"{luaName}.OnResume"); LuaOnAnimationStart = GameMode.XLua.GetInPath <OnAnimationStart>($"{luaName}.OnAnimationStart"); LuaOnAnimationComplete = GameMode.XLua.GetInPath <OnAnimationComplete>($"{luaName}.OnAnimationComplete"); LuaOnEventTrigger = GameMode.XLua.GetInPath <OnEventTrigger>($"{luaName}.OnEventTrigger"); LuaOnColliderTrigger = GameMode.XLua.GetInPath <OnColliderTrigger>($"{luaName}.OnColliderTrigger"); }
public void Clear() { LuaOnInit = null; LuaOnFree = null; LuaOnUpdate = null; LuaOnEnter = null; LuaOnExit = null; LuaPause = null; LuaOnResume = null; LuaOnAnimationStart = null; LuaOnAnimationComplete = null; LuaOnEventTrigger = null; LuaOnColliderTrigger = null; }
public void RegisterTimerModel(ITimerModel model) { model.OnSplit += (s, e) => OnSplit?.Invoke(this, e); model.OnSkipSplit += (s, e) => OnSkipSplit?.Invoke(this, e); model.OnUndoSplit += (s, e) => OnUndoSplit?.Invoke(this, e); model.OnStart += (s, e) => OnStart?.Invoke(this, e); model.OnReset += (s, e) => OnReset?.Invoke(this, e); model.OnPause += (s, e) => OnPause?.Invoke(this, e); model.OnResume += (s, e) => OnResume?.Invoke(this, e); model.OnScrollUp += (s, e) => OnScrollUp?.Invoke(this, e); model.OnScrollDown += (s, e) => OnScrollDown?.Invoke(this, e); model.OnSwitchComparisonPrevious += (s, e) => OnSwitchComparisonPrevious?.Invoke(this, e); model.OnSwitchComparisonNext += (s, e) => OnSwitchComparisonNext?.Invoke(this, e); }
public void StartGame(string _m) { switch (_m) { case "Controller": if (!WSB_InputManager.I.ChangeControllers(ControlsMode.Controller, isBanController)) { return; } break; case "Keyboard": if (!WSB_InputManager.I.ChangeControllers(ControlsMode.Keyboard, isBanController)) { return; } break; case "Both": if (!WSB_InputManager.I.ChangeControllers(ControlsMode.ControllerKeyboard, isBanController)) { return; } break; default: return; } // Get all the rigidbody in the scene and unfreeze them Rigidbody2D[] _physics = FindObjectsOfType <Rigidbody2D>(); foreach (Rigidbody2D _r in _physics) { if (_r.GetComponent <WSB_Player>() || _r.GetComponent <WSB_Movable>() || _r.GetComponent <WSB_MovingPlateform>() || _r.transform.tag == "Earth") { continue; } _r.isKinematic = false; } // Set Pause to false Paused = false; OnResume?.Invoke(); //// Hide menu //menu.SetActive(false); }
public void InvokeResume() { if (!IsPaused) { return; } if (MusicController.IsPaused) { MusicController.Play(); } IsPaused = false; OnResume?.Invoke(); }
/// <summary> /// Toggle whether the game is paused /// </summary> public void TogglePause() { Paused = !paused; if (Paused) { Cursor.visible = true; OnPause?.Invoke(); } else { Cursor.visible = false; OnResume?.Invoke(); } }
public void Resume() { if (GameStateManager.instance != false) { AudioManager.instance.PlayAtRandomPitch("ClickSFX"); pauseScreen.SetActive(false); GameStateManager.instance.ResumeGame(); if (SettingsMenu.instance.IsVisible()) { SettingsMenu.instance.ToggleSettings(false, false); } OnResume?.Invoke(); InitStateManager.currGameMode = GameModes.Powercut; } }
void Awake() { Debug.Log("Setting PauseGameUI singleton"); //Setup singleton if (singleton == null) { singleton = this; } else { Destroy(gameObject); return; } onResume = null; }
public UIManager(UIComponents _components) { components = _components; components.pauseButton.onClick.AddListener(() => { OnPause?.Invoke(); components.panel.SetActive(true); }); components.resumeButton.onClick.AddListener(() => { OnResume?.Invoke(); components.panel.SetActive(false); }); }
public void Pause() { if (CurrentState.CurrentPhase == TimerPhase.Running) { CurrentState.TimePausedAt = CurrentState.CurrentTime.RealTime.Value; CurrentState.CurrentPhase = TimerPhase.Paused; OnPause?.Invoke(this, null); } else if (CurrentState.CurrentPhase == TimerPhase.Paused) { CurrentState.AdjustedStartTime = TimeStamp.Now - CurrentState.TimePausedAt; CurrentState.CurrentPhase = TimerPhase.Running; OnResume?.Invoke(this, null); } else if (CurrentState.CurrentPhase == TimerPhase.NotRunning) { Start(); //f**k abahbob } }
private void Update() { timeSinceOpen += Time.deltaTime; if (InputManager.GetInput("Pause") > 0f && !isShifting && canPause) { if (IsPaused) { OnResume?.Invoke(); } else { OnPause?.Invoke(); } isShifting = true; shiftingUp = IsPaused; } if (isShifting) { float scl = Time.timeScale; scl += Time.unscaledDeltaTime / (shiftingUp ? SHIFT_DURATION : -SHIFT_DURATION); if (scl <= 0f || scl >= intendedTimeSpeed) { Time.timeScale = Mathf.Clamp(scl, 0f, intendedTimeSpeed); isPaused = !isPaused; isShifting = false; } else { Time.timeScale = scl; } } Time.fixedDeltaTime = IsStopped ? 1f : 0.01666666f / Time.timeScale; }
public void PressResume() { OnResume?.Invoke(); }
public void Resume() { // Set Pause state to false, invoke resume event, hide pause menu Paused = false; OnResume?.Invoke(); }
private void OnOnResume() { OnResume?.Invoke(this, EventArgs.Empty); }
public void BroadcastResume() { OnResume?.Invoke(); }
public void Resume() { OnResume.Invoke(); }
public void Resume() { GameIsPause = false; OnResume.Invoke(); }
/// <summary> /// Invoked when dialog resumes after pausing. /// </summary> public virtual void WhenDialogResume() { OnResume?.Invoke(); }
public void Resume(string input) { OnResume?.Invoke(); Pause.paused = false; SceneManager.LoadScene("Level1"); }
public void OnBaseResume(object sender, EventArgs e) { OnResume?.Invoke(sender, e); }
private void InvokeResumeActions() { OnResume?.Invoke(); SetCurrentStateMachineType(previousStateMachineType); }
public Event() { OnResume.AddEventListener(DefaultResume); OnAwait.AddEventListener(DefaultAwait); }
public static void ResumeGame() { OnResume?.Invoke(); }