protected void OnPaused() { if (Paused != null) { Paused.Invoke(this); } }
public void Pause() { // Keep the gun from shooting isPaused = true; canShoot = false; Paused.Invoke(); }
protected virtual void OnPaused(EventArgs e) { if (Paused != null) { Paused.Invoke(this, e); } }
void OnPayloadReceived(object sender, Misc.PayloadReceivedEventArgs e) { var msg = e.Payload; if (msg.EventType == "TIMER") { if (msg.Event == "CALL_START") { Started?.Invoke(this, new EventArgs()); } if (msg.Event == "CALL_START_PAUSE") { Paused?.Invoke(this, new EventArgs()); } if (msg.Event == "CALL_END_PAUSE") { Unpaused?.Invoke(this, new EventArgs()); } if (msg.Event == "CALL_END") { Stopped?.Invoke(this, new EventArgs()); } if (msg.Event == "CALL_CANCEL") { Canceled?.Invoke(this, new EventArgs()); } } }
public void Pause() { _soundOut.Pause(); this.PlayState = PlayState.Paused; Paused?.Invoke(); }
public void PauseGame() { Cursor.lockState = CursorLockMode.Confined; Cursor.visible = true; Paused?.Invoke(true); }
public void Start() { TimeSpan endTime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second).Add(TimeLeft); if (!isRunning) //if it is already running ther's no meaning for starting again { Device.StartTimer(TimeSpan.FromMilliseconds(SpreedControl()), () => { isRunning = true; TimeSpan nowTime = new TimeSpan(DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second); TimeLeft = endTime - nowTime; var ticked = TimeLeft.TotalSeconds > 0; if (isPause) { Paused?.Invoke(); ticked = false; isRunning = false; } else if (ticked) { Ticked?.Invoke(); } else { Completed?.Invoke(); } return(ticked); }); } }
public void ResumeGame() { Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; Paused?.Invoke(false); }
internal void OnPaused(DebuggerPausedEventArgs e) { AssertPaused(); DisableAllSteppers(); foreach (var corBreakpoint in tempBreakpoints) { corBreakpoint.Activate(0); } tempBreakpoints.Clear(); // No real purpose - just additional check if (callbackInterface.IsInCallback) { throw new DebuggerException("Can not raise event within callback."); } TraceMessage("Debugger event: OnPaused()"); if (Paused != null) { foreach (EventHandler <DebuggerPausedEventArgs> d in Paused.GetInvocationList()) { if (IsRunning) { TraceMessage("Skipping OnPaused delegate because process has resumed"); break; } if (this.TerminateCommandIssued || this.HasExited) { TraceMessage("Skipping OnPaused delegate because process has exited"); break; } d(this, e); } } }
void ReleaseDesignerOutlets() { if (Paused != null) { Paused.Dispose(); Paused = null; } if (RestartBtn != null) { RestartBtn.Dispose(); RestartBtn = null; } if (SpawnBtn != null) { SpawnBtn.Dispose(); SpawnBtn = null; } if (StopBtn != null) { StopBtn.Dispose(); StopBtn = null; } if (UrhoSurfacePlaceholder != null) { UrhoSurfacePlaceholder.Dispose(); UrhoSurfacePlaceholder = null; } }
void OnGUI() { if ((Input.touchCount > 0 || Input.anyKeyDown) && !isRunning) { GameManager.TriggerGameStart(); } inScore.text = "Score : " + Score; GUI.Label(new Rect(0.5f, -0.5f, 10, 10), Score.ToString()); if (!paused && isRunning) { if (GUI.Button(new Rect(Screen.width - (Screen.width * 11 / 100f), (Screen.height * 1) / 100, Screen.width * 10 / 100f, Screen.width * 10 / 100f), "II")) { Time.timeScale = 0; InGame.SetActive(false); Paused.SetActive(true); paused = true; } } else if (isRunning) { if (GUI.Button(new Rect(Screen.width / 2 - (Screen.width * 25 / 100f) / 2, Screen.height / 2 + (Screen.height * 10 / 100f) / 2, (Screen.width * 25 / 100f), (Screen.height * 10 / 100f)), "Resume")) { Time.timeScale = 1; InGame.SetActive(true); Paused.SetActive(false); paused = false; } } }
/// <summary> /// Pauses the video playback. /// </summary> public override void Pause() { _timer?.Stop(); base.Pause(); Status = MediaPlayerStatus.Paused; Paused.RaiseEvent(this); }
// HACK: public public virtual void OnPaused() { AssertPaused(); // No real purpose - just additional check if (callbackInterface.IsInCallback) { throw new DebuggerException("Can not raise event within callback."); } TraceMessage("Debugger event: OnPaused()"); if (Paused != null) { foreach (Delegate d in Paused.GetInvocationList()) { if (IsRunning) { TraceMessage("Skipping OnPaused delegate because process has resumed"); break; } if (this.TerminateCommandIssued || this.HasExited) { TraceMessage("Skipping OnPaused delegate because process has exited"); break; } d.DynamicInvoke(this, new ProcessEventArgs(this)); } } }
public void Update(TimeSpan frameTime) { if (Paused.IsActiveAndNotNull()) { return; } if (ObjectsToAdd.Any()) { Objects.AddRange(ObjectsToAdd); ObjectsToAdd.Clear(); } HasRemovedObjects = false; foreach (var o in Objects) { if (!o.Root.IsRemoved) { o.Update(frameTime); } else { HasRemovedObjects = true; } } }
public override void OnPause(Action baseOnPause) { var service = Get <INavigationService>(); service.OnPauseActivity(Target, NavigationContext); Paused?.Invoke(Target, EventArgs.Empty); base.OnPause(baseOnPause); }
public void Pause() { if (Interlocked.CompareExchange(ref m_paused, new TaskCompletionSource <bool>(), null) == null) { Paused?.Invoke(); PauseStatusChanged?.Invoke(true); } }
public virtual void Pause() { isPaused = true; Paused.Invoke(); // Stop registering collisions rigidbody.Sleep(); }
public void Stop() { if (Running) { _gameTime.Stop(); Paused?.Invoke(this, EventArgs.Empty); } }
private void DestroyEvents() { Started?.RemoveAllListeners(); Paused?.RemoveAllListeners(); Resumed?.RemoveAllListeners(); Stopped?.RemoveAllListeners(); LoopPointReached?.RemoveAllListeners(); }
public void Pause() { // Keep this from moving or registering collisions velocity = Vector3.zero; rigidbody.Sleep(); isPaused = true; Paused.Invoke(); }
public void Pause() { if (this.IsRunning && !this.IsPaused) { this.IsPaused = true; OnPaused(); Paused?.Invoke(this); } }
public void Pause(PausedBy playbackPausedBy = PausedBy.User) { if (_output != null) { _output.Pause(); Paused?.Invoke(new Paused(playbackPausedBy)); } }
public void Pause() { if (!Running.IsCompleted) { throw new InvalidOperationException("Service was not running but is being paused"); } Paused.Complete(true); }
public Task NotifyPause() { if (Paused != null) { return(Paused.Invoke()); } return(Task.CompletedTask); }
/// <summary> /// Raises the <see cref="Paused"/> event. /// </summary> private void OnPaused() { foreach (var subscriber in subscribers) { subscriber.ClockPaused(); } Paused?.Invoke(this); }
public virtual void Pause() { if (IsRunning && !_isPaused) { _pauseSignal.Reset(); _isPaused = true; Paused?.Invoke(this, null); } }
public void PauseGame() { gamePaused = true; Paused.Invoke(); if (pauseMenu != null && pauseMenu.activeSelf == false) { pauseMenu.SetActive(true); } }
/// <summary> /// Pauses emulation. /// </summary> public void Pause() { if (ROMIsLoaded == false) { return; } IsPaused = true; Paused?.Invoke(); }
public void Pause() { if (IsPaused) { return; } IsPaused = true; Paused?.Invoke(this, EventArgs.Empty); popup.WindowState = WindowState.Minimized; }
protected override void OnPause() { base.OnPause(); Paused?.Invoke(this); if (_orientationListener.CanDetectOrientation()) { _orientationListener.Disable(); } }
void Start () { // //Initialize the game in 'pause mode' // pauseMenu = GameObject.Find("PauseMenu").GetComponent<Canvas>(); pauseHint = GameObject.Find ("PauseHint").GetComponent<Canvas>(); targetReticule = GameObject.Find("TargetReticule").GetComponent<Canvas>(); thisPilot = gameObject.GetComponent<Pilot>(); thisPilot.enabled = false; thisGrounded = gameObject.GetComponent<Paused>(); targetReticule.enabled = false; pauseHint.enabled = false; }