コード例 #1
0
    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);
    }
コード例 #2
0
ファイル: Cursor.cs プロジェクト: M3L6H/DemolitionDefense
    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);
    }
コード例 #3
0
ファイル: Logger.cs プロジェクト: M3L6H/DemolitionDefense
 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);
 }
コード例 #4
0
 protected void Awake()
 {
     // Register listeners
     GameWonEvent.RegisterListener(GameWon);
 }