public GoldReserve(int initialGold, TroopEvent minionDeadEvent, TroopEvent removedMinionAtWaveEndEvent) { currentGold = initialGold; deadMinionEvent = minionDeadEvent; deadMinionEvent.RegisterListener(AddGold); this.removedMinionAtWaveEndEvent = removedMinionAtWaveEndEvent; this.removedMinionAtWaveEndEvent.RegisterListener(AddGoldOnWaveEnd); }
private void Start() { phaseData = GetComponent <RunTimePhaseData>(); heroDeathEvent.RegisterListener(HandleHeroDeath); troopDeathEvent.RegisterListener(HandleTroopDeath); towerDestroyedEvent.RegisterListener(HandleTowerDestruction); gameEndEvent.RegisterListener(HandleFinalWaveEnd); }
private void Start() { closeTargets = new List <Transform>(); waveEndEvent.RegisterListener(OnWaveEnd); troopDeathEvent.RegisterListener(OnTroopDeath); towerDestroyedEvent.RegisterListener(OnTowerDestruction); attackingTowerEvent.RegisterListener(OnTroopAttackingTower); heroDeathEvent.RegisterListener(OnHeroDeath); }