private void WinnerHook(WinnerType value) { this.winner = value; if (this.gameOver) { EventSystem.Publish(this, GameOverEvent); } }
public void TrySlaveEscape() { if (this.IsSplitscreen || (this.networkGameManager?.isServer ?? true)) { if (this.currentPaddles == MaxPaddle && this.currentFood == MaxFood) { this.winner = WinnerType.Slave; this.networkGameManager.winner = WinnerType.Slave; this.gameOver = true; this.networkGameManager.gameOver = true; EventSystem.Publish(this, GameOverEvent); } } }
public void DamageSlave() { if (this.IsSplitscreen || (this.networkGameManager?.isServer ?? true)) { --this.currentHealth; --this.networkGameManager.currentHealth; EventSystem.Publish(this, HealthChangeEvent); if (this.currentHealth == 0) { this.winner = WinnerType.Landlord; this.networkGameManager.winner = WinnerType.Landlord; this.gameOver = true; this.networkGameManager.gameOver = true; EventSystem.Publish(this, GameOverEvent); } } }
private void WinnerHookInternal(GameManager.WinnerType value) { Debug.Log("WinnerHookInternal: " + value); this.WinnerHook(value); }