public void AddBoostNotifier(Boost boostPrefab) { for (int i = 0; i < notifiersInProgress.Count; i++) { Boost notifierBoost = ((BoostNotifier)notifiersInProgress[i]).GetBoost(); if (notifierBoost.GetType() == boostPrefab.GetType() && notifierBoost.GetState() != BoostStates.FINISHED) { notifierBoost.SetActive(); return; } } BoostNotifier notifier = GetBoostNotifier(); Boost boost = Instantiate(boostPrefab) as Boost; boost.SetActive(); notifier.SetBoost(boost); AddNotifier(notifier); }
private BoostNotifier GetBoostNotifier() { BoostNotifier notifier = Instantiate(boostNotifierPrefab) as BoostNotifier; return(notifier); }