Beispiel #1
0
        public Bar GetNextBar()
        {
            Bar nextBar = preparedBars.Dequeue();

            nextBar.Prepare(ProceduralPathGenerator.GetBarData(ScoreKeeper.Score));
            activeBars.Enqueue(nextBar);
            return(nextBar);
        }
Beispiel #2
0
        public void RecycleBars()
        {
            if (preparedBars.Count >= minimumNumberOfPreparedBars)
            {
                return;
            }

            float yPos = preparedBars.Last().transform.localPosition.y + 2;

            Bar bottomBar = activeBars.Dequeue();

            bottomBar.SetYPosition(yPos);
            bottomBar.Prepare(ProceduralPathGenerator.GetBarData(ScoreKeeper.Score));
            preparedBars.Enqueue(bottomBar);
        }