예제 #1
0
        protected async Task PlayAnimation(LottieAnimation animationName)
        {
            if (AnimationView.IsAnimating)
            {
                return;
            }

            await AnimationView.SetAnimationAsync(System.IO.Path.Combine(LOTTIE_ANIMATIONS_DIRECTORY, animationName.ToString() + ".json"), LottieAnimationView.CacheStrategy.Strong);

            if (FadesEnabled)
            {
                ((Storyboard)Resources["AnimationFadeIn"])?.Begin();
            }

            AnimationView.Speed       = 0.5f;
            AnimationView.RepeatCount = 0;
            AnimationView.PlayAnimation();

            await Task.Delay(2500);

            if (FadesEnabled)
            {
                ((Storyboard)Resources["AnimationFadeOut"])?.Begin();
            }
        }
예제 #2
0
 protected override void Clicked()
 {
     _animationView.PlayAnimation();
 }
    public void WinningRewards()
    {
        lReelReward = PlayerDataController.Controller.reelRewardsModel.reelRewards.Single(s => s.reelFigure.Equals(PlayerDataController.Controller.mReelFigure.ToString()));

        //Debug.Log(mWinlineCalculation.mRepetitionCount);

        if (!lReelReward.HasMatchType(mWinlineCalculation.mRepetitionCount))
        {
            Invoke(nameof(OnReelIdle), 0.1f);
            return;
        }

        lMatchType = lReelReward.matchType.Single(s => s.matchSymbols.Equals(mWinlineCalculation.mRepetitionCount));

        //Debug.Log(lMatchType);

        switch (PlayerDataController.Controller.mReelFigure)
        {
        case ReelFigures.eCoin:
            mAnimation.PlayAnimation("Coin");
            lRewards       = lMatchType.rewards.Single(s => s.type.Equals("eCoin"));
            mBetMultiplier = mBets.GetBetsAmount();
            mTotalAmount   = lRewards.amount * mBetMultiplier;
            PlayerDataController.Controller.playerItems.Coins = mTotalAmount;
            break;

        case ReelFigures.eAttack:
            DOTween.KillAll();
            Invoke(nameof(AttackVillage), 1f);
            return;

        case ReelFigures.eRaid:
            DOTween.KillAll();
            Invoke(nameof(RaidVillage), 1f);
            return;

        default:

            break;
        }

        lRewards = lMatchType.rewards.Single(s => s.type.Equals("XP"));

        PlayerDataController.Controller.playerItems.Xp = lRewards.amount;

        Debug.Log("XP Reward : " + lRewards.amount);

        Debug.Log("PlayerItems.Xp : " + PlayerDataController.Controller.playerItems.Xp);

        PlayerDataController.Controller.IsNewLevelAchieved();

        Debug.Log("PlayerItems.Xp : " + PlayerDataController.Controller.playerItems.Xp);

        lLevel = PlayerDataController.Controller.GetLevel();

        mPlayerProgress.ShowData(lLevel.level, PlayerDataController.Controller.playerItems.Xp, lLevel.fromXP, lLevel.toXP);

        ShowData();

        if (PlayerDataController.Controller.mReelFigure == ReelFigures.eAttack || PlayerDataController.Controller.mReelFigure == ReelFigures.eCoin || PlayerDataController.Controller.mReelFigure == ReelFigures.eRaid)
        {
            Invoke(nameof(OnReelIdle), 0.1f);
            return;
        }


        Invoke(nameof(OnReelIdle), 0.1f);
    }