Inheritance: MonoBehaviour
Exemplo n.º 1
0
 protected void OnPaused()
 {
     if (Paused != null)
     {
         Paused.Invoke(this);
     }
 }
Exemplo n.º 2
0
 public void Pause()
 {
     // Keep the gun from shooting
     isPaused = true;
     canShoot = false;
     Paused.Invoke();
 }
Exemplo n.º 3
0
 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());
                }
            }
        }
Exemplo n.º 5
0
        public void Pause()
        {
            _soundOut.Pause();

            this.PlayState = PlayState.Paused;
            Paused?.Invoke();
        }
Exemplo n.º 6
0
        public void PauseGame()
        {
            Cursor.lockState = CursorLockMode.Confined;
            Cursor.visible   = true;

            Paused?.Invoke(true);
        }
Exemplo n.º 7
0
        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);
                });
            }
        }
Exemplo n.º 8
0
        public void ResumeGame()
        {
            Cursor.lockState = CursorLockMode.Locked;
            Cursor.visible   = false;

            Paused?.Invoke(false);
        }
Exemplo n.º 9
0
        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);
                }
            }
        }
Exemplo n.º 10
0
        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;
            }
        }
Exemplo n.º 11
0
 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);
 }
Exemplo n.º 13
0
 // 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));
         }
     }
 }
Exemplo n.º 14
0
        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;
                }
            }
        }
Exemplo n.º 15
0
        public override void OnPause(Action baseOnPause)
        {
            var service = Get <INavigationService>();

            service.OnPauseActivity(Target, NavigationContext);
            Paused?.Invoke(Target, EventArgs.Empty);
            base.OnPause(baseOnPause);
        }
Exemplo n.º 16
0
 public void Pause()
 {
     if (Interlocked.CompareExchange(ref m_paused, new TaskCompletionSource <bool>(), null) == null)
     {
         Paused?.Invoke();
         PauseStatusChanged?.Invoke(true);
     }
 }
Exemplo n.º 17
0
    public virtual void Pause()
    {
        isPaused = true;
        Paused.Invoke();

        // Stop registering collisions
        rigidbody.Sleep();
    }
Exemplo n.º 18
0
 public void Stop()
 {
     if (Running)
     {
         _gameTime.Stop();
         Paused?.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 19
0
 private void DestroyEvents()
 {
     Started?.RemoveAllListeners();
     Paused?.RemoveAllListeners();
     Resumed?.RemoveAllListeners();
     Stopped?.RemoveAllListeners();
     LoopPointReached?.RemoveAllListeners();
 }
Exemplo n.º 20
0
    public void Pause()
    {
        // Keep this from moving or registering collisions
        velocity = Vector3.zero;
        rigidbody.Sleep();

        isPaused = true;
        Paused.Invoke();
    }
Exemplo n.º 21
0
 public void Pause()
 {
     if (this.IsRunning && !this.IsPaused)
     {
         this.IsPaused = true;
         OnPaused();
         Paused?.Invoke(this);
     }
 }
Exemplo n.º 22
0
        public void Pause(PausedBy playbackPausedBy = PausedBy.User)
        {
            if (_output != null)
            {
                _output.Pause();

                Paused?.Invoke(new Paused(playbackPausedBy));
            }
        }
Exemplo n.º 23
0
        public void Pause()
        {
            if (!Running.IsCompleted)
            {
                throw new InvalidOperationException("Service was not running but is being paused");
            }

            Paused.Complete(true);
        }
Exemplo n.º 24
0
        public Task NotifyPause()
        {
            if (Paused != null)
            {
                return(Paused.Invoke());
            }

            return(Task.CompletedTask);
        }
Exemplo n.º 25
0
        /// <summary>
        /// Raises the <see cref="Paused"/> event.
        /// </summary>
        private void OnPaused()
        {
            foreach (var subscriber in subscribers)
            {
                subscriber.ClockPaused();
            }

            Paused?.Invoke(this);
        }
Exemplo n.º 26
0
 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);
        }
    }
Exemplo n.º 28
0
        /// <summary>
        /// Pauses emulation.
        /// </summary>
        public void Pause()
        {
            if (ROMIsLoaded == false)
            {
                return;
            }

            IsPaused = true;
            Paused?.Invoke();
        }
Exemplo n.º 29
0
 public void Pause()
 {
     if (IsPaused)
     {
         return;
     }
     IsPaused = true;
     Paused?.Invoke(this, EventArgs.Empty);
     popup.WindowState = WindowState.Minimized;
 }
Exemplo n.º 30
0
        protected override void OnPause()
        {
            base.OnPause();
            Paused?.Invoke(this);

            if (_orientationListener.CanDetectOrientation())
            {
                _orientationListener.Disable();
            }
        }
Exemplo n.º 31
0
	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;
	}