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();
            }
        }
Beispiel #2
0
 private void DisablePlayerControlls()
 {
     foreach (IPausable pausable in _pausables)
     {
         pausable.Pause();
     }
     _interactable.Pause();
 }
Beispiel #3
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);
    }
Beispiel #4
0
    private void OnPause(bool pause)
    {
        if (pausableComponents == null)
        {
            return;
        }

        foreach (Component c in pausableComponents)
        {
            if (c is IPausable)
            {
                IPausable pausable = c as IPausable;
                pausable.Pause(pause);
            }
        }
    }
Beispiel #5
0
 public void DisplayScene(Scene scene, IPausable pausable)
 {
     if (ActorDirectory.Instance == null)
     {
         throw new System.Exception("ActorDirectory is not active in this scene. Maybe you forgot to add it into globals?");
     }
     if (gameObject.activeInHierarchy)
     {
         Debug.LogWarning("A new Scene was loaded when an old one was still playing. Was this desired behaviour?");
         this.pausable = null;
         Hide();
     }
     JumpToNode   = -1;
     DecisionMade = -1;
     exitRequest  = false;
     CurrentScene = scene;
     gameObject.SetActive(true);
     this.pausable = pausable;
     pausable.Pause();
     NextAction();
 }