public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(EnemyCurrentHealthEvent)) { if (!transitioning) { EnemyCurrentHealthEvent currentHealthEvent = e as EnemyCurrentHealthEvent; SetHealth(currentHealthEvent.currentHealth); SetDisplayHealth(Mathf.CeilToInt(currentHealthEvent.currentHealth)); } } else if (e.GetType() == typeof(EnemyMaxHealthEvent)) { EnemyMaxHealthEvent maxHealthEvent = e as EnemyMaxHealthEvent; SetMaxHealth(maxHealthEvent.maxHealth); } else if (e.GetType() == typeof(EnemyStartingDataEvent)) { EnemyStartingDataEvent startingDataEvent = e as EnemyStartingDataEvent; this.maxPhase = startingDataEvent.maxPhase; AddExtraBars(); } else if (e.GetType() == typeof(EnemyHealthTransitionEvent)) { EnemyHealthTransitionEvent transitionEvent = e as EnemyHealthTransitionEvent; StartCoroutine(PhaseTransitionHealth(transitionEvent.duration, transitionEvent.nextPhase)); } }
public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(PlayerVictoryEvent)) { MatchFinish(true); } else if (e.GetType() == typeof(PlayerDefeatEvent)) { MatchFinish(false); } else if (e.GetType() == typeof(EnemyStartingDataEvent)) { phase = 1; EnemyStartingDataEvent enemyDataEvent = e as EnemyStartingDataEvent; if (enemyText != null) { enemyText.text = enemyDataEvent.name; } } else if (e.GetType() == typeof(PhaseTransitionEvent)) { PhaseTransitionEvent phaseTransitionEvent = e as PhaseTransitionEvent; phase = phaseTransitionEvent.nextPhase; } }
public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(EnemyStartingDataEvent)) { EnemyStartingDataEvent displayLevelEvent = e as EnemyStartingDataEvent; SetEnemyLevelDisplay(displayLevelEvent.level); } }
public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(EnemyStartingDataEvent)) { EnemyStartingDataEvent dataEvent = e as EnemyStartingDataEvent; this.currentPhase = 1; this.maxPhase = dataEvent.maxPhase; } }
public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(EnemyStartingDataEvent)) { EnemyStartingDataEvent startingDataEvent = e as EnemyStartingDataEvent; if (startingDataEvent.level < 0) { startingDataEvent.level = 0; } SetStats(startingDataEvent.level); } }
public void ConsumeEvent(IEvent e) { if (e.GetType() == typeof(EnemyStartingDataEvent)) { EnemyStartingDataEvent startingDataEvent = e as EnemyStartingDataEvent; if (startingDataEvent.level < 0) { startingDataEvent.level = 0; } SetStats(1, startingDataEvent.level, startingDataEvent.maxPhase); this.level = startingDataEvent.level; this.maxPhase = startingDataEvent.maxPhase; } else if (e.GetType() == typeof(PhaseTransitionEvent)) { PhaseTransitionEvent phaseTransitionEvent = e as PhaseTransitionEvent; SetStats(phaseTransitionEvent.nextPhase, level, maxPhase); } }