private IEnumerator CoolDown() { float currentCharge = 0.0f; while (currentCharge < currentBoosterPrefab.m_CoolDownTime) { currentCharge += Time.deltaTime; float percentage = currentCharge / currentBoosterPrefab.m_CoolDownTime; // change boost loading UI to mirror numbers BoostLoading boostLoading = GameMaster.Instance.m_UIManager.m_BoostLoading; if (boostLoading != null) { boostLoading.SetPercentage(percentage); } yield return(null); } // NOW CAN USE BOOSTER! canActivate = true; // set boost image to current booster image BoostLoading boostLoadingUI = GameMaster.Instance.m_UIManager.m_BoostLoading; boostLoadingUI.SetBoostSprite(currentBoosterPrefab.m_UISprite); boostLoadingUI.SetPercentage(100.0f); }
// sets equipped booster but doesnt activate it public void SetEquippedBooster(Booster booster) { currentBoosterPrefab = booster; BoostLoading boostLoadingUI = GameMaster.Instance.m_UIManager.m_BoostLoading; boostLoadingUI.SetBoostSprite(currentBoosterPrefab.m_UISprite); }