Ejemplo n.º 1
0
    public void HandleClick(string targetProductId)
    {
        int currentDiamondAmount = diamondController.GetDiamondAmount();

        switch (targetProductId)
        {
        case Constants.SmallHeart:
        {
            if (currentDiamondAmount < 15)
            {
                base.ToggleNoDiamondPopup(true);
                return;
            }

            diamondController.SubtractDiamondAmount(15);
            newHeartController.AddHeartAmount(5);
            afterPurchaseEffectController.ShowScreen("0", 5);
            break;
        }

        case Constants.LargeHeart:
        {
            if (currentDiamondAmount < 120)
            {
                base.ToggleNoDiamondPopup(true);
                return;
            }

            diamondController.SubtractDiamondAmount(120);
            newHeartController.AddHeartAmount(50);
            afterPurchaseEffectController.ShowScreen("0", 50);
            break;
        }

        case Constants.HeartRechargeSpeedUp:
        {
            if (currentDiamondAmount < 20)
            {
                base.ToggleNoDiamondPopup(true);
                return;
            }

            diamondController.SubtractDiamondAmount(20);
            newHeartController.UpgradeHeartRechargeSpeed(2);
            afterPurchaseEffectController.ShowScreen("1", 0);
            SetSpeedUpText();
            break;
        }
        }
    }
Ejemplo n.º 2
0
    private void OnRewaredVideoSuccess()
    {
        Initialize();
        switch (rewardType)
        {
        case AD_REWARD_TYPE.GET_REWARD_ITEM: {
            uiController.ShowRewardEffect();
            break;
        }

        case AD_REWARD_TYPE.GET_ALL_DICES: {
            noDiceNoCoinController.HideScreen();
            resetDiceController.AbleResetDiceButton();
            resetDiceController.ResetDices();
            break;
        }

        case AD_REWARD_TYPE.LOAD_CLICKED_MAP: {
            newHeartController.AddHeartAmount(1);
            mapController.OnClickMap();
            break;
        }

        case AD_REWARD_TYPE.LOAD_LEVEL_SCENE: {
            newHeartController.AddHeartAmount(1);
            if (levelLoader.GetIsGoingToNextLevel())
            {
                levelLoader.LoadNextLevel();
                levelLoader.SetIsGoingToNextLevel(false);
                return;
            }
            levelLoader.LoadCurrentScene();
            break;
        }
        }
    }