private void OnEnable() { playerSkinConfig = playerSkinController.GetNextUnlockable(); bool foundUnlockable = playerSkinConfig != null; nextSkinText.gameObject.SetActive(foundUnlockable); coinsLeftText.gameObject.SetActive(foundUnlockable); skinImage.gameObject.SetActive(foundUnlockable); if (!foundUnlockable) { return; } skinImage.sprite = playerSkinConfig.Sprite; int coinsNeeded = playerSkinConfig.Price - coinsTracker.TotalCoinsCollected; if (coinsNeeded < 0) { coinsLeftText.SetText("GET THIS LOOK NOW!"); } else { coinsLeftText.SetText(string.Format(defaultCoinsLeftText, coinsNeeded)); } }
private void OnTryUnlockSkin(PlayerSkinStoreView obj) { playerSkinConfigToUnlock = obj.PlayerSkinConfig; ShowUnlockPopup(); }
/// <summary> /// Use this to have control over when the unlock popup is shown externally /// </summary> /// <param name="playerSkinConfig"></param> public void ShowUnlockPopup(PlayerSkinConfig playerSkinConfig) { playerSkinConfigToUnlock = playerSkinConfig; ShowUnlockPopup(); }