public void BoostFinished(Boost boost) //Переписать бы надо, а что делать( { FlyOut(); if (boost.GetType() == typeof(VodkaBoost)) { GlobalOptions.GetGuiLayer().StopVodka(); } if (boost.GetType() == typeof(MagnitBoost)) { GlobalOptions.GetGuiLayer().StopMagnit(); } if (boost.GetType() == typeof(X2Boost)) { GlobalOptions.GetGuiLayer().StopX2(); } if (boost.GetType() == typeof(HeadStartBoost)) { GlobalOptions.GetGuiLayer().StopHeadStart(); } Destroy(boost.gameObject); }
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); }