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(); } }
private void EnablePlayerControlls() { foreach (IPausable pausable in _pausables) { pausable.Resume(); } _interactable.Resume(); }
public void Hide() { ActiveActors.ForEach(x => GameObject.Destroy(x.gameObject)); ActiveActors.Clear(); gameObject.SetActive(false); if (pausable != null) { pausable.Resume(); } }
/** * Register a pausable object with the manager */ public void RegisterPausable(IPausable pausable) { if (timeState == TimeState.Paused) { pausable.Pause(); } else { pausable.Resume(); } pausableObjects.Add(pausable); }