Esempio n. 1
0
        public void AdvanceTimeline(double time)
        {
            onTimeAdvanceStart?.Invoke();

            double startTime = now;
            double endTime   = now + time;

            for (int i = 0; i < timeline.Count; i++)
            {
                TimelineEvent e = timeline[i];

                if (e.timestamp > endTime)
                {
                    break;
                }

                now = e.timestamp;
                onTimeAdvanced?.Invoke(now - startTime);

                e.action(e.data);
            }
            ClearEvents(new ClearEventFilter(null, 0, endTime));

            Console.WriteLine(ToString());

            now = endTime;

            onTimeAdvanceEnd?.Invoke();
        }