Ejemplo n.º 1
0
    public void BuyGachapon()
    {
        // Check if there is not enough cash
        if (!PlayerSetting.TakeCoins(GachaponMachine.Cost))
        {
            // Do not allow buying
            return;
        }

        // Generate the skin
        rewardSkin = GachaponMachine.GetRandomSkin();

        if (rewardSkin != null)
        {
            // Set the reward image
            rewardImage.sprite = rewardSkin.PreviewSprite;

            // Set the reward name
            RewardText.text = rewardSkin.SkinName;

            // Play the animation
            startAnimation();

            // Store the skin
            PlayerSetting.AddToSkinStorage(rewardSkin);
        }
    }
    // Use this for initialization
    void Start()
    {
#if DEBUG_BUTTONS
        foreach (var skin in LoadSkins)
        {
            skin.Load();
            PlayerSetting.AddToSkinStorage(skin);
        }
#endif
        Load();
    }