Exemple #1
0
    public void ButtonAction()
    {
        // Depending if unlocked or not, either purchase or select item
        if (isUnlocked)
        {
            // Swap the asset
            switch (itemtype)
            {
            case EAssetType.BACKGROUND:
                swapper.BackgroundSelect(unlockIndex);
                break;

            case EAssetType.MUSIC:
                swapper.MusicSelect(unlockIndex);
                break;

            case EAssetType.OBSTACLE:
                swapper.ObstacleSelect(unlockIndex);
                break;
            }

            if (!isInShop)
            {
                parentShop.InitItems();
            }
            else
            {
                storeOption.ItemCheck();
            }
        }
        else
        {
            if (isInShop && itemtype == EAssetType.MUSIC)
            {
                SwapManager.instance.Preview(itemtype, unlockIndex);
            }
            confirmPurchasePrompt.SetPrompt("Purchase Item?", price.ToString(), ConfirmPurchase);
        }
    }