Esempio n. 1
0
    public void ShowReward(Fragment fragment)
    {
        switch (fragment.type)
        {
        case typeReward.Coin:
            reward.gameObject.SetActive(true);
            reward.text = fragment.reward.ToString();
            imgReward.gameObject.SetActive(false);
            PlushSpin.gameObject.SetActive(false);
            TransCoin.gameObject.SetActive(true);
            fragment.ApplyReward();
            break;

        case typeReward.Skin:
            reward.gameObject.SetActive(false);
            imgReward.gameObject.SetActive(true);
            PlushSpin.gameObject.SetActive(false);
            imgReward.sprite = fragment.Skin.sprite;
            TransCoin.gameObject.SetActive(false);
            fragment.ApplyReward();
            break;

        case typeReward.Spin:
            SpinCtrl.Ins.RandomSkin();
            reward.gameObject.SetActive(false);
            imgReward.gameObject.SetActive(false);
            PlushSpin.gameObject.SetActive(true);
            TransCoin.gameObject.SetActive(false);

            fragment.ApplyReward();
            break;
        }
    }