// something has changed (item change, purchase, etc). Need to refresh the gui text public void RefreshStoreGUI() { int cost = -1; if (storeSelectingPowerUp) { PowerUpTypes powerUp = (PowerUpTypes)storeItemIndex; cost = dataManager.GetPowerUpCost(powerUp); storeBuyButton.SetActive(cost != -1); if (useuGUI) { storeTitleText.text = dataManager.GetPowerUpTitle(powerUp); storeDescriptionText.text = dataManager.GetPowerUpDescription(powerUp); storePowerUpSelectionButtonText.text = "Characters"; } else { #if COMPILE_NGUI storeTitle.text = dataManager.GetPowerUpTitle(powerUp); storeDescription.text = dataManager.GetPowerUpDescription(powerUp); storePowerUpSelectionButton.text = "Characters"; #endif } } else // characters { cost = dataManager.GetCharacterCost(storeItemIndex); storeBuyButton.SetActive(cost != -1); if (useuGUI) { storeTitleText.text = dataManager.GetCharacterTitle(storeItemIndex); storeDescriptionText.text = dataManager.GetCharacterDescription(storeItemIndex); storePowerUpSelectionButtonText.text = "Power Ups"; } else { #if COMPILE_NGUI storeTitle.text = dataManager.GetCharacterTitle(storeItemIndex); storeDescription.text = dataManager.GetCharacterDescription(storeItemIndex); storePowerUpSelectionButton.text = "Power Ups"; #endif } } if (useuGUI) { storeCoinsText.text = string.Format("{0} ({1} Coins Available)", (cost == -1 ? "Purchased" : string.Format("Cost: {0}", cost.ToString())), dataManager.GetTotalCoins(true)); } else { #if COMPILE_NGUI storeCoins.text = string.Format("{0} ({1} Coins Available)", (cost == -1 ? "Purchased" : string.Format("Cost: {0}", cost.ToString())), dataManager.GetTotalCoins(true)); #endif } }