public static void Load() { dispatcher = new PluginDispatcher(); boardStore = new BoardStore(dispatcher); info = new InfoBoxController(boardStore); // Game GameEvents.OnInMenu.Add(OnInMenu); GameEvents.OnGameStart.Add(OnGameStart); GameEvents.OnGameEnd.Add(OnGameEnd); // Player GameEvents.OnPlayerDraw.Add(OnPlayerDraw); GameEvents.OnPlayerGet.Add(OnPlayerGet); GameEvents.OnPlayerPlay.Add(OnPlayerPlay); GameEvents.OnPlayerCreateInPlay.Add(OnPlayerPlay); GameEvents.OnPlayerDeckToPlay.Add(OnPlayerPlay); // Opponent GameEvents.OnOpponentPlay.Add(OnOpponentPlay); GameEvents.OnOpponentCreateInPlay.Add(OnOpponentPlay); GameEvents.OnOpponentDeckToPlay.Add(OnOpponentPlay); dispatcher.OnActionReceived(ACTION_TYPE.INIT); }
// Update is called once per frame void Update() { // Keep track of pay if (_isEarning) { EarnMoney(); } // Check if you beat the level or lost CheckForPromotion(); CheckFired(); CheckBots(); // Run code review timer if (_codeReviewActive) { CodeReview(); } // present alerts if needed. if (messageCount > 0) { if (!_alertDisplayed) { _infoBox = FindObjectOfType <InfoBoxController>(); _infoBox.SetText(" ALERT\n\n\n" + _globalAlertQueue.Dequeue()); _infoBox.ShowBox(); _alertDisplayed = true; } } else if (messageCount == 0 && _influence < -15) // Handles the case of being fired. { ResetGame(); } // If you are on a computer scene, reduce computer time. if (_currentSceneName.Contains("Computer")) { ReduceComputerTime(Time.deltaTime); } }