protected void Awake() { if (NEBound == null || SWBound == null) { Debug.LogError("Bounds not set!"); } CameraLocked = true; // Register listeners GameStartEvent.RegisterListener(GameStart); GameWonEvent.RegisterListener(GameWon); GameOverEvent.RegisterListener(GameOver); }
protected void Awake() { if (GridRef == null) { Debug.LogError($"{name}: no grid object assigned!"); } if (ForbiddenMap == null) { Debug.LogError($"{name}: no forbidden map assigned!"); } if (ForbiddenTile == null) { Debug.LogError($"{name}: no forbidden tile assigned!"); } spriteRenderer = GetComponentInChildren <SpriteRenderer>(); if (spriteRenderer == null) { Debug.LogError($"{name}: no graphic child game object!"); } gm = FindObjectOfType <GameManager>(); if (gm == null) { Debug.LogError($"{name}: no game manager found!"); } defenderMenuButton = FindObjectOfType <DefenderMenuButton>(); if (defenderMenuButton == null) { Debug.LogError($"{name}: no defender menu button found!"); } cursor = spriteRenderer.sprite; CursorDisabled = true; // Register listeners GameOverEvent.RegisterListener(GameOver); GameWonEvent.RegisterListener(GameWon); GameStartEvent.RegisterListener(GameStart); MenuEvent.RegisterListener(Menu); }
protected void Awake() { PauseEvent.RegisterListener(LogEvent); MenuEvent.RegisterListener(LogEvent); TileSoldEvent.RegisterListener(LogEvent); TileDestroyedEvent.RegisterListener(LogEvent); TileDamageEvent.RegisterListener(LogEvent); TileUpdateEvent.RegisterListener(LogEvent); BaseDamageEvent.RegisterListener(LogEvent); BaseDamageUIEvent.RegisterListener(LogEvent); PurchaseMadeEvent.RegisterListener(LogEvent); PartsChangedUIEvent.RegisterListener(LogEvent); EnemyRecycledEvent.RegisterListener(LogEvent); GameStartEvent.RegisterListener(LogEvent); GameOverEvent.RegisterListener(LogEvent); GameWonEvent.RegisterListener(LogEvent); FastForwardEvent.RegisterListener(LogEvent); }
protected void Awake() { // Register listeners GameWonEvent.RegisterListener(GameWon); }