public static void Notify(object sender, GameEventArgs e) { switch (e.type) { case START_GAME: StartGame?.Invoke(sender, e); break; case PAUSE_GAME: PauseGame?.Invoke(sender, e); break; case RESUME_GAME: ResumeGame?.Invoke(sender, e); break; case STOP_GAME: StopGame?.Invoke(sender, e); break; case RESTART_GAME: RestartGame?.Invoke(sender, e); break; case START_MINI_GAME: StartMiniGame?.Invoke(sender, e); break; case END_MINI_GAME: EndMiniGame?.Invoke(sender, e); break; } }
/// <summary> /// Use it for notify from EventTrigger Component. Requires to be component on GameObject! /// </summary> /// <param name="sender">The sender object.</param> /// <param name="e">Event arguments</param> public void Notify(string type) { switch (type) { case START_GAME: StartGame?.Invoke(null, new GameEventArgs(type)); break; case PAUSE_GAME: PauseGame?.Invoke(null, new GameEventArgs(type)); break; case RESUME_GAME: ResumeGame?.Invoke(null, new GameEventArgs(type)); break; case STOP_GAME: StopGame?.Invoke(null, new GameEventArgs(type)); break; case RESTART_GAME: RestartGame?.Invoke(null, new GameEventArgs(type)); break; case START_MINI_GAME: StartMiniGame?.Invoke(null, new GameEventArgs(type)); break; case END_MINI_GAME: EndMiniGame?.Invoke(null, new GameEventArgs(type)); break; } }
void Update() { if (resume != null && quit != null && menu != null) { RaycastHit seen; Ray raydirection = new Ray(transform.position, transform.forward); if (Physics.Raycast(raydirection, out seen, sightlength)) { if (seen.collider.tag.Equals("ResumeGame")) { if (resume.load()) { pgc.resume(); } } else if (seen.collider.tag.Equals("QuitGame")) { if (quit.load()) { Application.Quit(); } } else if (seen.collider.transform.name.Equals("MenuGame")) { if (menu.load()) { pgc.inactivatePauseMenu(); Time.timeScale = 1; gameManager.resetGame(); SceneManager.LoadScene("GameStart"); } } else { resume.unload(); quit.unload(); menu.unload(); } } else { resume.unload(); quit.unload(); menu.unload(); } } else { resume = FindObjectOfType <ResumeGame>(); quit = FindObjectOfType <QuitGame>(); menu = FindObjectOfType <MenuGame>(); } }
/// <summary> /// /// </summary> /// <param name="KinectSensor">The <see cref="Microsoft.Kinect.KinectSensor"/> associated to the game</param> public GameController(Microsoft.Kinect.KinectSensor KinectSensor) { attRandom = new Random(1); attKinectInterrogator = new KinectInterrogator( KinectSensor, REFRESH_TIME ); attDataBase = new Helpers.DBHelper(); attResumeGame = new ResumeGame(); attUnloadGame = new UnloadGame(); attUpdateInventory = new UpdateInventory(); attNotifyItemException = new NotifyItemException(); attKinectInterrogator.PlayerEnterKinectSensorEvent = HandlePlayerEnterKinectSensor; attKinectInterrogator.PlayerLeaveKinectSensorEvent = HandlePlayerLeaveKinectSensor; attKinectInterrogator.BarCodeRecognizedEvent = HandleBarCodeRecognized; }
void OnResumeButtonClicked() { ResumeGame.Invoke(); }
private void OnButtonClicked() { ResumeGame?.Invoke(); }
public static void OnResumeGame() { ResumeGame?.Invoke(); }
private void OnResumeGame() { ResumeGame?.Invoke(); }