Пример #1
0
        /// <summary>
        /// Updates the contained hit objects based on the specified time.
        /// </summary>
        public void UpdateObjects(float curTime)
        {
            bool advanceLowIndex = true;

            for (int i = hitObjectViews.LowIndex; i < hitObjectViews.Count; i++)
            {
                var view = hitObjectViews[i];

                // Record dragging flag.
                // Ensure we don't apply the generous release handicap here as it'll screw up the replay score sync.
                if (view.IsHoldable)
                {
                    gameProcessor.RecordDraggerHoldFlag(view.ObjectIndex, view.IsHolding(null));
                }

                // Process any passive judgements to be made.
                gameProcessor.JudgePassive(curTime, view);

                if (view.IsFullyJudged)
                {
                    // Advance low index?
                    if (advanceLowIndex)
                    {
                        hitObjectViews.AdvanceLowIndex(true);
                    }
                }
                else
                {
                    advanceLowIndex = false;

                    float approachProgress = view.GetApproachProgress(curTime);

                    // If not fully judged and disabled, this should be an upcoming hit object.
                    if (!view.Active)
                    {
                        // If should show, make it active and increase high index.
                        if (approachProgress >= 0f)
                        {
                            view.Active = true;
                            hitObjectViews.AdvanceHighIndex(true);
                        }
                        // If not, all other objects wouldn't be shown since the objects are sorted by start time.
                        else
                        {
                            break;
                        }
                    }
                    // Move object.
                    view.Y = Mathf.LerpUnclamped(PlayArea.FallStartPos, PlayArea.HitPosition, approachProgress);
                }
            }
        }