// Update is called once per frame void Update() { if (score >= winScore && score != 0) { Debug.Log("Level Complete"); SuccessMessage successMessage = new SuccessMessage(); successMessage.nextLevel = nextLevel; successMessage.nextLevelWinScore = nextLevelWinScore; Debug.Log("Publishing Success Message"); AudioManager.instance.Play("Win"); PubSubServerInstance.Publish(successMessage); score = 0; winScore = nextLevelWinScore; } if (Input.GetKeyDown(KeyCode.Escape)) { Debug.Log("Level Failed"); FailureMessage failureMessage = new FailureMessage(); Debug.Log("Publishing Failure Message"); PubSubServerInstance.Publish(failureMessage); AudioManager.instance.Play("Fail"); } }
public void StartGame() { Debug.Log("PlayButton pressed, requesting game start"); StartGameMessage startGameMessage = new StartGameMessage(); PubSubServerInstance.Publish(startGameMessage); }