Beispiel #1
0
        /// <summary> Routine the yields until the next frame's update. Current routine must be managed. </summary>
        public static Routine WaitForNextFrame()
        {
            var nextFrameRoutine = Get <Routine>(true);

            nextFrameRoutine.Trace(1);
            var resumer = new LightResumer {
                routine = nextFrameRoutine, id = nextFrameRoutine.id
            };

            Current.manager.AddNextFrameResumer(ref resumer);
            return(nextFrameRoutine);
        }
 /// <summary>
 /// Internal use only. Schedules a lightweight resumer to be called next frame.
 /// </summary>
 public void AddNextFrameResumer(ref LightResumer resumer)
 {
     pendingNextFrameResumers.Add(resumer);
 }