示例#1
0
        public void Execute()
        {
            DateTime now = DateTime.Now;

            LobbyUiEntity[] awards = movingAwardsGroup.GetEntities();
            for (int index = 0; index < awards.Length; index++)
            {
                LobbyUiEntity movingAward = awards[index];
                DateTime      arrivalTime = movingAward.movingIcon.iconTrajectory.controlPoints.Last().arrivalTime;
                if (arrivalTime <= now)
                {
                    int increment = movingAward.movingIcon.increment;
                    switch (movingAward.movingIcon.awardTypeEnum)
                    {
                    case AwardTypeEnum.SoftCurrency:
                        uiSoundsManager.PlaySoftAdding();
                        lobbyUiContext.ReplaceSoftCurrency(lobbyUiContext.softCurrency.value + increment);
                        break;

                    case AwardTypeEnum.AccountRating:
                        uiSoundsManager.PlayRatingAdding();
                        lobbyUiContext.ReplaceAccountRating(lobbyUiContext.accountRating.value + increment);
                        break;

                    case AwardTypeEnum.HardCurrency:
                        uiSoundsManager.PlayHardAdding();
                        lobbyUiContext.ReplaceHardCurrency(lobbyUiContext.hardCurrency.value + increment);
                        break;

                    case AwardTypeEnum.LootboxPoints:
                        uiSoundsManager.PlayPointsAdding();
                        lobbyUiContext.ReplacePointsForSmallLootbox(lobbyUiContext.pointsForSmallLootbox.value + increment);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }

                    Object.Destroy(movingAward.view.gameObject);
                    movingAward.Destroy();
                }
            }
        }