Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
 private void OnTryUnlockSkin(PlayerSkinStoreView obj)
 {
     playerSkinConfigToUnlock = obj.PlayerSkinConfig;
     ShowUnlockPopup();
 }
Exemplo n.º 3
0
 /// <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();
 }