private IEnumerator Animation(WarshipPowerPointsResourceModel resourceModel) { yield return(new WaitUntil(() => wppContext != null)); int startValue = resourceModel.StartValue; int maxValue = resourceModel.MaxValueForLevel; wppContext.ReplaceWarshipPowerPoints(startValue, maxValue); int amount = resourceModel.FinishValue - resourceModel.StartValue; string skinName = resourceModel.WarshipTypeEnum.ToString(); StartCoroutine(WarshipAnimation(skinName, amount)); }
public void Execute() { DateTime now = DateTime.UtcNow; var awards = movingAwardsGroup.GetEntities(); for (int index = 0; index < awards.Length; index++) { var entity = awards[index]; DateTime arrivalTime = entity.movingIcon.iconTrajectory.controlPoints.Last().arrivalTime; if (arrivalTime <= now) { // int increment = entity.movingIcon.increment; Object.Destroy(entity.view.gameObject); entity.Destroy(); uiSoundsManager.PlayWarshipPowerPointsAccrual(); //обновить значение шкалы int oldValue = context.warshipPowerPoints.value; context.ReplaceWarshipPowerPoints(oldValue + 1, context.warshipPowerPoints.maxValueForLevel); } } }