private void KeyRelease(object sender, KeyEventArgs e)
        {
            // Gets the data context.
            KinectController model = DataContext as KinectController;

            IPausable viewModel = model.NavigationManager.CurrentNavigationContext as IPausable;

            // The current view model is not IPausable
            if (viewModel == null)
            {
                return;
            }

            if (e.Key == Key.Space)
            {
                if (viewModel.IsPaused)
                {
                    viewModel.Resume();
                }
                else
                {
                    viewModel.Pause();
                }
            }

            if (e.Key == Key.Escape)
            {
                model.NavigationManager.GoBack();
            }
        }
예제 #2
0
 private void EnablePlayerControlls()
 {
     foreach (IPausable pausable in _pausables)
     {
         pausable.Resume();
     }
     _interactable.Resume();
 }
예제 #3
0
파일: Viewer.cs 프로젝트: RhythNS/Toybox
 public void Hide()
 {
     ActiveActors.ForEach(x => GameObject.Destroy(x.gameObject));
     ActiveActors.Clear();
     gameObject.SetActive(false);
     if (pausable != null)
     {
         pausable.Resume();
     }
 }
예제 #4
0
    /**
     * Register a pausable object with the manager
     */
    public void RegisterPausable(IPausable pausable)
    {
        if (timeState == TimeState.Paused)
        {
            pausable.Pause();
        }
        else
        {
            pausable.Resume();
        }

        pausableObjects.Add(pausable);
    }