C# Class SpicyPixel.Threading.UnityFiberScheduler

FiberScheduler that can execute fibers (yieldable coroutines) during the update cycle of a MonoBehaviour.
Inheritance: FiberScheduler
Afficher le fichier Open project: spicypixel/concurrency-kit-cs

Méthodes publiques

Méthode Description
ToString ( ) : string

Returns a System.String that represents the current SpicyPixel.Threading.UnityFiberScheduler.

UnityFiberScheduler ( MonoBehaviour behaviour ) : System

Initializes a new instance of the SpicyPixel.Threading.UnityFiberScheduler class.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Dispose the scheduler.

QueueFiber ( Fiber fiber ) : void

Queues the fiber for execution on the scheduler.

Fibers queued from the scheduler thread will generally be executed inline whenever possible on most schedulers.

Private Methods

Méthode Description
ExecuteFiberInternal ( Fiber fiber, bool singleStep = false, int fiberSwitchCount ) : IEnumerator

Wraps fiber execution to translate between framework and Unity concepts.

ProcessFiberQueue ( ) : IEnumerator

Runs on the scheduler thread and dispatches all queued fibers.

StartUnityFiber ( Fiber fiber ) : void

Starts a fiber using the Unity scheduler.

This wraps the fiber in a special coroutine in order to convert between the framework and Unity. Additionally it saves the Unity coroutine and associates it with the fiber so it can be used later for wait operations. Note that Unity StartCoroutine will execute inline to the first yield.

Method Details

Dispose() protected méthode

Dispose the scheduler.
protected Dispose ( bool disposing ) : void
disposing bool /// Disposing. ///
Résultat void

QueueFiber() protected méthode

Queues the fiber for execution on the scheduler.
Fibers queued from the scheduler thread will generally be executed inline whenever possible on most schedulers.
protected QueueFiber ( Fiber fiber ) : void
fiber Fiber /// The fiber to queue. ///
Résultat void

ToString() public méthode

Returns a System.String that represents the current SpicyPixel.Threading.UnityFiberScheduler.
public ToString ( ) : string
Résultat string

UnityFiberScheduler() public méthode

Initializes a new instance of the SpicyPixel.Threading.UnityFiberScheduler class.
public UnityFiberScheduler ( MonoBehaviour behaviour ) : System
behaviour UnityEngine.MonoBehaviour /// The behaviour to use for scheduling with Unity. ///
Résultat System