Exemple #1
0
 private void LogEvent(PartsChangedUIEvent e)
 {
     if (e.LoggingLevel <= LoggingLevel)
     {
         Debug.Log(e.Description);
     }
 }
Exemple #2
0
 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);
 }
Exemple #3
0
    protected void Awake()
    {
        textBox = GetComponent <TextMeshProUGUI>();

        if (textBox == null)
        {
            Debug.LogError($"{name} does not have a text component!");
        }

        gm = FindObjectOfType <GameManager>();

        if (gm == null)
        {
            Debug.LogError($"{name} no game manager found!");
        }

        // Register listeners
        PartsChangedUIEvent.RegisterListener(PartsChanged);
    }
Exemple #4
0
 protected void OnDestroy()
 {
     PartsChangedUIEvent.UnregisterListener(PartsChanged);
 }
Exemple #5
0
 private void PartsChanged(PartsChangedUIEvent e)
 {
     textBox.text = gm.Parts.ToString();
 }