My Project
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | Events | List of all members
MEC.Timing Class Reference
Inheritance diagram for MEC.Timing:

Public Member Functions

void DebugLog ()
 
CoroutineHandle RunCoroutineOnInstance (IEnumerator< float > coroutine)
 Run a new coroutine on this Timing instance in the Update segment.
 
CoroutineHandle RunCoroutineOnInstance (IEnumerator< float > coroutine, string tag)
 Run a new coroutine on this Timing instance in the Update segment.
 
CoroutineHandle RunCoroutineOnInstance (IEnumerator< float > coroutine, Segment segment)
 Run a new coroutine on this Timing instance.
 
CoroutineHandle RunCoroutineOnInstance (IEnumerator< float > coroutine, Segment segment, string tag)
 Run a new coroutine on this Timing instance.
 
int KillCoroutinesOnInstance ()
 This will kill all coroutines running on the current MEC instance and reset the context. NOTE: If you call this function from within a running coroutine then you MUST end the current coroutine. If the running coroutine has more work to do you may run a new "part 2" coroutine function to complete the task before ending the current one.
 
int KillCoroutinesOnInstance (CoroutineHandle handle)
 Kills the instance of the coroutine handle on this Timing instance if it exists.
 
int KillCoroutinesOnInstance (string tag)
 Kills all coroutines that have the given tag.
 
int PauseCoroutinesOnInstance ()
 This will pause all coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.
 
int PauseCoroutinesOnInstance (CoroutineHandle handle)
 This will pause any matching coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.
 
int PauseCoroutinesOnInstance (string tag)
 This will pause any matching coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.
 
int ResumeCoroutinesOnInstance ()
 This resumes all coroutines on this MEC instance if they are currently paused, otherwise it has no effect.
 
int ResumeCoroutinesOnInstance (CoroutineHandle handle)
 This will resume any matching coroutines running on this MEC instance.
 
int ResumeCoroutinesOnInstance (string tag)
 This resumes any matching coroutines on this MEC instance if they are currently paused, otherwise it has no effect.
 
float WaitForSecondsOnInstance (float waitTime)
 Use "yield return timingInstance.WaitForSecondsOnInstance(time);" to wait for the specified number of seconds.
 
bool LockCoroutine (CoroutineHandle coroutine, CoroutineHandle key)
 Keeps this coroutine from executing until UnlockCoroutine is called with a matching key.
 
bool UnlockCoroutine (CoroutineHandle coroutine, CoroutineHandle key)
 Unlocks a coroutine that has been locked, so long as the key matches.
 
CoroutineHandle CallDelayedOnInstance (float delay, System.Action action)
 Calls the specified action after a specified number of seconds.
 
CoroutineHandle CallDelayedOnInstance (float delay, System.Action action, GameObject cancelWith)
 Calls the specified action after a specified number of seconds.
 
CoroutineHandle CallDelayedOnInstance (float delay, Segment segment, System.Action action)
 Calls the specified action after a specified number of seconds.
 
CoroutineHandle CallDelayedOnInstance (float delay, Segment segment, System.Action action, GameObject gameObject)
 Calls the specified action after a specified number of seconds.
 
CoroutineHandle CallPeriodicallyOnInstance (float timeframe, float period, System.Action action, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
CoroutineHandle CallPeriodicallyOnInstance (float timeframe, float period, System.Action action, Segment segment, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
CoroutineHandle CallContinuouslyOnInstance (float timeframe, System.Action action, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
CoroutineHandle CallContinuouslyOnInstance (float timeframe, System.Action action, Segment timing, System.Action onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
CoroutineHandle CallPeriodicallyOnInstance< T > (T reference, float timeframe, float period, System.Action< T > action, System.Action< T > onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
CoroutineHandle CallPeriodicallyOnInstance< T > (T reference, float timeframe, float period, System.Action< T > action, Segment timing, System.Action< T > onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
CoroutineHandle CallContinuouslyOnInstance< T > (T reference, float timeframe, System.Action< T > action, System.Action< T > onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
CoroutineHandle CallContinuouslyOnInstance< T > (T reference, float timeframe, System.Action< T > action, Segment timing, System.Action< T > onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
new Coroutine StartCoroutine (System.Collections.IEnumerator routine)
 
new Coroutine StartCoroutine (string methodName, object value)
 
new Coroutine StartCoroutine (string methodName)
 
new Coroutine StartCoroutine_Auto (System.Collections.IEnumerator routine)
 
new void StopCoroutine (string methodName)
 
new void StopCoroutine (System.Collections.IEnumerator routine)
 
new void StopCoroutine (Coroutine routine)
 
new void StopAllCoroutines ()
 

Static Public Member Functions

static CoroutineHandle RunCoroutine (IEnumerator< float > coroutine)
 Run a new coroutine in the Update segment.
 
static CoroutineHandle RunCoroutine (IEnumerator< float > coroutine, string tag)
 Run a new coroutine in the Update segment.
 
static CoroutineHandle RunCoroutine (IEnumerator< float > coroutine, Segment segment)
 Run a new coroutine.
 
static CoroutineHandle RunCoroutine (IEnumerator< float > coroutine, Segment segment, string tag)
 Run a new coroutine.
 
static int KillCoroutines ()
 This will kill all coroutines running on the main MEC instance and reset the context. NOTE: If you call this function from within a running coroutine then you MUST end the current coroutine. If the running coroutine has more work to do you may run a new "part 2" coroutine function to complete the task before ending the current one.
 
static int KillCoroutines (CoroutineHandle handle)
 Kills the instances of the coroutine handle if it exists.
 
static int KillCoroutines (string tag)
 Kills all coroutines that have the given tag.
 
static int PauseCoroutines ()
 This will pause all coroutines running on the current MEC instance until ResumeCoroutines is called.
 
static int PauseCoroutines (CoroutineHandle handle)
 This will pause any matching coroutines until ResumeCoroutines is called.
 
static int PauseCoroutines (string tag)
 This will pause any matching coroutines running on the current MEC instance until ResumeCoroutines is called.
 
static int ResumeCoroutines ()
 This resumes all coroutines on the current MEC instance if they are currently paused, otherwise it has no effect.
 
static int ResumeCoroutines (CoroutineHandle handle)
 This will resume any matching coroutines.
 
static int ResumeCoroutines (string tag)
 This resumes any matching coroutines on the current MEC instance if they are currently paused, otherwise it has no effect.
 
static Timing GetInstance (byte ID)
 Retrieves the MEC manager that corresponds to the supplied instance id.
 
static float WaitForSeconds (float waitTime)
 Use "yield return Timing.WaitForSeconds(time);" to wait for the specified number of seconds.
 
static float WaitUntilDone (CoroutineHandle otherCoroutine)
 Use the command "yield return Timing.WaitUntilDone(otherCoroutine);" to pause the current coroutine until otherCoroutine is done.
 
static float WaitUntilDone (CoroutineHandle otherCoroutine, bool warnOnIssue)
 Use the command "yield return Timing.WaitUntilDone(otherCoroutine, false);" to pause the current coroutine until otherCoroutine is done, supressing warnings.
 
static float WaitUntilDone (WWW wwwObject)
 Use the command "yield return Timing.WaitUntilDone(wwwObject);" to pause the current coroutine until the wwwObject is done.
 
static float WaitUntilDone (AsyncOperation operation)
 Use the command "yield return Timing.WaitUntilDone(operation);" to pause the current coroutine until the operation is done.
 
static float WaitUntilDone (CustomYieldInstruction operation)
 Use the command "yield return Timing.WaitUntilDone(operation);" to pause the current coroutine until the operation is done.
 
static CoroutineHandle CallDelayed (float delay, System.Action action)
 Calls the specified action after a specified number of seconds.
 
static CoroutineHandle CallDelayed (float delay, System.Action action, GameObject cancelWith)
 Calls the specified action after a specified number of seconds.
 
static CoroutineHandle CallDelayed (float delay, Segment segment, System.Action action)
 Calls the specified action after a specified number of seconds.
 
static CoroutineHandle CallDelayed (float delay, Segment segment, System.Action action, GameObject gameObject)
 Calls the specified action after a specified number of seconds.
 
static CoroutineHandle CallPeriodically (float timeframe, float period, System.Action action, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
static CoroutineHandle CallPeriodically (float timeframe, float period, System.Action action, Segment segment, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
static CoroutineHandle CallContinuously (float timeframe, System.Action action, System.Action onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
static CoroutineHandle CallContinuously (float timeframe, System.Action action, Segment timing, System.Action onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
static CoroutineHandle CallPeriodically< T > (T reference, float timeframe, float period, System.Action< T > action, System.Action< T > onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
static CoroutineHandle CallPeriodically< T > (T reference, float timeframe, float period, System.Action< T > action, Segment timing, System.Action< T > onDone=null)
 Calls the supplied action at the given rate for a given number of seconds.
 
static CoroutineHandle CallContinuously< T > (T reference, float timeframe, System.Action< T > action, System.Action< T > onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
static CoroutineHandle CallContinuously< T > (T reference, float timeframe, System.Action< T > action, Segment timing, System.Action< T > onDone=null)
 Calls the supplied action every frame for a given number of seconds.
 
static new void Destroy (Object obj)
 
static new void Destroy (Object obj, float f)
 
static new void DestroyObject (Object obj)
 
static new void DestroyObject (Object obj, float f)
 
static new void DestroyImmediate (Object obj)
 
static new void DestroyImmediate (Object obj, bool b)
 
static new void Instantiate (Object obj)
 
static new void Instantiate (Object original, Vector3 position, Quaternion rotation)
 
static new void Instantiate< T > (T original)
 
static new T FindObjectOfType< T > ()
 
static new Object FindObjectOfType (System.Type t)
 
static new T[] FindObjectsOfType< T > ()
 
static new Object[] FindObjectsOfType (System.Type t)
 
static new void print (object message)
 

Public Attributes

float TimeBetweenSlowUpdateCalls = 1f / 7f
 The time between calls to SlowUpdate.
 
DebugInfoType ProfilerDebugAmount
 The amount that each coroutine should be seperated inside the Unity profiler. NOTE: When the profiler window is not open this value is ignored and all coroutines behave as if "None" is selected.
 
int UpdateCoroutines
 The number of coroutines that are being run in the Update segment.
 
int FixedUpdateCoroutines
 The number of coroutines that are being run in the FixedUpdate segment.
 
int LateUpdateCoroutines
 The number of coroutines that are being run in the LateUpdate segment.
 
int SlowUpdateCoroutines
 The number of coroutines that are being run in the SlowUpdate segment.
 
float localTime
 The time in seconds that the current segment has been running.
 
float deltaTime
 The amount of time in fractional seconds that elapsed between this frame and the last frame.
 

Static Public Attributes

static System.Func< IEnumerator< float >, CoroutineHandle, IEnumerator< float > > ReplacementFunction
 Used for advanced coroutine control.
 
const float WaitForOneFrame = float.NegativeInfinity
 You can use "yield return Timing.WaitForOneFrame;" inside a coroutine function to go to the next frame.
 

Properties

static float LocalTime [get]
 The time in seconds that the current segment has been running.
 
static float DeltaTime [get]
 The amount of time in fractional seconds that elapsed between this frame and the last frame.
 
static System.Threading.Thread MainThread [get]
 The main thread that (almost) everything in unity runs in.
 
static CoroutineHandle CurrentCoroutine [get]
 The handle of the current coroutine that is running.
 
CoroutineHandle currentCoroutine [get]
 The handle of the current coroutine that is running.
 
static Timing Instance [get, set]
 

Events

static System.Action OnPreExecute
 This event fires just before each segment is run.
 

Member Function Documentation

◆ CallContinuously() [1/2]

static CoroutineHandle MEC.Timing.CallContinuously ( float  timeframe,
System::Action  action,
Segment  timing,
System::Action  onDone = null 
)
inlinestatic

Calls the supplied action every frame for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuously() [2/2]

static CoroutineHandle MEC.Timing.CallContinuously ( float  timeframe,
System::Action  action,
System::Action  onDone = null 
)
inlinestatic

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuously< T >() [1/2]

static CoroutineHandle MEC.Timing.CallContinuously< T > ( reference,
float  timeframe,
System::Action< T >  action,
Segment  timing,
System::Action< T >  onDone = null 
)
inlinestatic

Calls the supplied action every frame for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each frame.
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuously< T >() [2/2]

static CoroutineHandle MEC.Timing.CallContinuously< T > ( reference,
float  timeframe,
System::Action< T >  action,
System::Action< T >  onDone = null 
)
inlinestatic

Calls the supplied action every frame for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each frame.
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuouslyOnInstance() [1/2]

CoroutineHandle MEC.Timing.CallContinuouslyOnInstance ( float  timeframe,
System::Action  action,
Segment  timing,
System::Action  onDone = null 
)
inline

Calls the supplied action every frame for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuouslyOnInstance() [2/2]

CoroutineHandle MEC.Timing.CallContinuouslyOnInstance ( float  timeframe,
System::Action  action,
System::Action  onDone = null 
)
inline

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuouslyOnInstance< T >() [1/2]

CoroutineHandle MEC.Timing.CallContinuouslyOnInstance< T > ( reference,
float  timeframe,
System::Action< T >  action,
Segment  timing,
System::Action< T >  onDone = null 
)
inline

Calls the supplied action every frame for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each frame.
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallContinuouslyOnInstance< T >() [2/2]

CoroutineHandle MEC.Timing.CallContinuouslyOnInstance< T > ( reference,
float  timeframe,
System::Action< T >  action,
System::Action< T >  onDone = null 
)
inline

Calls the supplied action every frame for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each frame.
timeframeThe number of seconds that this function should run.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayed() [1/4]

static CoroutineHandle MEC.Timing.CallDelayed ( float  delay,
Segment  segment,
System::Action  action 
)
inlinestatic

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
segmentThe timing segment that the call should be made in.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayed() [2/4]

static CoroutineHandle MEC.Timing.CallDelayed ( float  delay,
Segment  segment,
System::Action  action,
GameObject  gameObject 
)
inlinestatic

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
gameObjectA GameObject that will be checked to make sure it hasn't been destroyed before calling the action.
segmentThe timing segment that the call should be made in.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayed() [3/4]

static CoroutineHandle MEC.Timing.CallDelayed ( float  delay,
System::Action  action 
)
inlinestatic

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayed() [4/4]

static CoroutineHandle MEC.Timing.CallDelayed ( float  delay,
System::Action  action,
GameObject  cancelWith 
)
inlinestatic

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
cancelWithA GameObject that will be checked to make sure it hasn't been destroyed before calling the action.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayedOnInstance() [1/4]

CoroutineHandle MEC.Timing.CallDelayedOnInstance ( float  delay,
Segment  segment,
System::Action  action 
)
inline

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
segmentThe timing segment that the call should be made in.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayedOnInstance() [2/4]

CoroutineHandle MEC.Timing.CallDelayedOnInstance ( float  delay,
Segment  segment,
System::Action  action,
GameObject  gameObject 
)
inline

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
gameObjectA GameObject that will be tagged onto the coroutine and checked to make sure it hasn't been destroyed before calling the action.
segmentThe timing segment that the call should be made in.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayedOnInstance() [3/4]

CoroutineHandle MEC.Timing.CallDelayedOnInstance ( float  delay,
System::Action  action 
)
inline

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
Returns
The handle to the coroutine that is started by this function.

◆ CallDelayedOnInstance() [4/4]

CoroutineHandle MEC.Timing.CallDelayedOnInstance ( float  delay,
System::Action  action,
GameObject  cancelWith 
)
inline

Calls the specified action after a specified number of seconds.

Parameters
delayThe number of seconds to wait before calling the action.
actionThe action to call.
cancelWithA GameObject that will be checked to make sure it hasn't been destroyed before calling the action.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodically() [1/2]

static CoroutineHandle MEC.Timing.CallPeriodically ( float  timeframe,
float  period,
System::Action  action,
Segment  segment,
System::Action  onDone = null 
)
inlinestatic

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
segmentThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodically() [2/2]

static CoroutineHandle MEC.Timing.CallPeriodically ( float  timeframe,
float  period,
System::Action  action,
System::Action  onDone = null 
)
inlinestatic

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodically< T >() [1/2]

static CoroutineHandle MEC.Timing.CallPeriodically< T > ( reference,
float  timeframe,
float  period,
System::Action< T >  action,
Segment  timing,
System::Action< T >  onDone = null 
)
inlinestatic

Calls the supplied action at the given rate for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each period.
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodically< T >() [2/2]

static CoroutineHandle MEC.Timing.CallPeriodically< T > ( reference,
float  timeframe,
float  period,
System::Action< T >  action,
System::Action< T >  onDone = null 
)
inlinestatic

Calls the supplied action at the given rate for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each period.
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodicallyOnInstance() [1/2]

CoroutineHandle MEC.Timing.CallPeriodicallyOnInstance ( float  timeframe,
float  period,
System::Action  action,
Segment  segment,
System::Action  onDone = null 
)
inline

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
segmentThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodicallyOnInstance() [2/2]

CoroutineHandle MEC.Timing.CallPeriodicallyOnInstance ( float  timeframe,
float  period,
System::Action  action,
System::Action  onDone = null 
)
inline

Calls the supplied action at the given rate for a given number of seconds.

Parameters
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodicallyOnInstance< T >() [1/2]

CoroutineHandle MEC.Timing.CallPeriodicallyOnInstance< T > ( reference,
float  timeframe,
float  period,
System::Action< T >  action,
Segment  timing,
System::Action< T >  onDone = null 
)
inline

Calls the supplied action at the given rate for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each period.
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
timingThe timing segment to run in.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ CallPeriodicallyOnInstance< T >() [2/2]

CoroutineHandle MEC.Timing.CallPeriodicallyOnInstance< T > ( reference,
float  timeframe,
float  period,
System::Action< T >  action,
System::Action< T >  onDone = null 
)
inline

Calls the supplied action at the given rate for a given number of seconds.

Parameters
referenceA value that will be passed in to the supplied action each period.
timeframeThe number of seconds that this function should run.
periodThe amount of time between calls.
actionThe action to call every frame.
onDoneAn optional action to call when this function finishes.
Returns
The handle to the coroutine that is started by this function.

◆ FindObjectOfType< T >()

static new T MEC.Timing.FindObjectOfType< T > ( )
inlinestatic
Type Constraints
T :Object 

◆ FindObjectsOfType< T >()

static new T[] MEC.Timing.FindObjectsOfType< T > ( )
inlinestatic
Type Constraints
T :Object 

◆ GetInstance()

static Timing MEC.Timing.GetInstance ( byte  ID)
inlinestatic

Retrieves the MEC manager that corresponds to the supplied instance id.

Parameters
IDThe instance ID.
Returns
The manager, or null if not found.

◆ Instantiate< T >()

static new void MEC.Timing.Instantiate< T > ( original)
inlinestatic
Type Constraints
T :Object 

◆ KillCoroutines() [1/3]

static int MEC.Timing.KillCoroutines ( )
inlinestatic

This will kill all coroutines running on the main MEC instance and reset the context. NOTE: If you call this function from within a running coroutine then you MUST end the current coroutine. If the running coroutine has more work to do you may run a new "part 2" coroutine function to complete the task before ending the current one.

Returns
The number of coroutines that were killed.

◆ KillCoroutines() [2/3]

static int MEC.Timing.KillCoroutines ( CoroutineHandle  handle)
inlinestatic

Kills the instances of the coroutine handle if it exists.

Parameters
handleThe handle of the coroutine to kill.
Returns
The number of coroutines that were found and killed (0 or 1).

◆ KillCoroutines() [3/3]

static int MEC.Timing.KillCoroutines ( string  tag)
inlinestatic

Kills all coroutines that have the given tag.

Parameters
tagAll coroutines with this tag will be killed.
Returns
The number of coroutines that were found and killed.

◆ KillCoroutinesOnInstance() [1/3]

int MEC.Timing.KillCoroutinesOnInstance ( )
inline

This will kill all coroutines running on the current MEC instance and reset the context. NOTE: If you call this function from within a running coroutine then you MUST end the current coroutine. If the running coroutine has more work to do you may run a new "part 2" coroutine function to complete the task before ending the current one.

Returns
The number of coroutines that were killed.

◆ KillCoroutinesOnInstance() [2/3]

int MEC.Timing.KillCoroutinesOnInstance ( CoroutineHandle  handle)
inline

Kills the instance of the coroutine handle on this Timing instance if it exists.

Parameters
handleThe handle of the coroutine to kill.
Returns
The number of coroutines that were found and killed (0 or 1).

◆ KillCoroutinesOnInstance() [3/3]

int MEC.Timing.KillCoroutinesOnInstance ( string  tag)
inline

Kills all coroutines that have the given tag.

Parameters
tagAll coroutines with this tag will be killed.
Returns
The number of coroutines that were found and killed.

◆ LockCoroutine()

bool MEC.Timing.LockCoroutine ( CoroutineHandle  coroutine,
CoroutineHandle  key 
)
inline

Keeps this coroutine from executing until UnlockCoroutine is called with a matching key.

Parameters
coroutineThe handle to the coroutine to be locked.
keyThe key to use. A new key can be generated by calling "new CoroutineHandle(0)".
Returns
Whether the lock was successful.

◆ PauseCoroutines() [1/3]

static int MEC.Timing.PauseCoroutines ( )
inlinestatic

This will pause all coroutines running on the current MEC instance until ResumeCoroutines is called.

Returns
The number of coroutines that were paused.

◆ PauseCoroutines() [2/3]

static int MEC.Timing.PauseCoroutines ( CoroutineHandle  handle)
inlinestatic

This will pause any matching coroutines until ResumeCoroutines is called.

Parameters
handleThe handle of the coroutine to pause.
Returns
The number of coroutines that were paused (0 or 1).

◆ PauseCoroutines() [3/3]

static int MEC.Timing.PauseCoroutines ( string  tag)
inlinestatic

This will pause any matching coroutines running on the current MEC instance until ResumeCoroutines is called.

Parameters
tagAny coroutines with a matching tag will be paused.
Returns
The number of coroutines that were paused.

◆ PauseCoroutinesOnInstance() [1/3]

int MEC.Timing.PauseCoroutinesOnInstance ( )
inline

This will pause all coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.

Returns
The number of coroutines that were paused.

◆ PauseCoroutinesOnInstance() [2/3]

int MEC.Timing.PauseCoroutinesOnInstance ( CoroutineHandle  handle)
inline

This will pause any matching coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.

Parameters
handleThe handle of the coroutine to pause.
Returns
The number of coroutines that were paused (0 or 1).

◆ PauseCoroutinesOnInstance() [3/3]

int MEC.Timing.PauseCoroutinesOnInstance ( string  tag)
inline

This will pause any matching coroutines running on this MEC instance until ResumeCoroutinesOnInstance is called.

Parameters
tagAny coroutines with a matching tag will be paused.
Returns
The number of coroutines that were paused.

◆ ResumeCoroutines() [1/3]

static int MEC.Timing.ResumeCoroutines ( )
inlinestatic

This resumes all coroutines on the current MEC instance if they are currently paused, otherwise it has no effect.

Returns
The number of coroutines that were resumed.

◆ ResumeCoroutines() [2/3]

static int MEC.Timing.ResumeCoroutines ( CoroutineHandle  handle)
inlinestatic

This will resume any matching coroutines.

Parameters
handleThe handle of the coroutine to resume.
Returns
The number of coroutines that were resumed (0 or 1).

◆ ResumeCoroutines() [3/3]

static int MEC.Timing.ResumeCoroutines ( string  tag)
inlinestatic

This resumes any matching coroutines on the current MEC instance if they are currently paused, otherwise it has no effect.

Parameters
tagAny coroutines previously paused with a matching tag will be resumend.
Returns
The number of coroutines that were resumed.

◆ ResumeCoroutinesOnInstance() [1/3]

int MEC.Timing.ResumeCoroutinesOnInstance ( )
inline

This resumes all coroutines on this MEC instance if they are currently paused, otherwise it has no effect.

Returns
The number of coroutines that were resumed.

◆ ResumeCoroutinesOnInstance() [2/3]

int MEC.Timing.ResumeCoroutinesOnInstance ( CoroutineHandle  handle)
inline

This will resume any matching coroutines running on this MEC instance.

Parameters
handleThe handle of the coroutine to resume.
Returns
The number of coroutines that were resumed (0 or 1).

◆ ResumeCoroutinesOnInstance() [3/3]

int MEC.Timing.ResumeCoroutinesOnInstance ( string  tag)
inline

This resumes any matching coroutines on this MEC instance if they are currently paused, otherwise it has no effect.

Parameters
tagAny coroutines previously paused with a matching tag will be resumend.
Returns
The number of coroutines that were resumed.

◆ RunCoroutine() [1/4]

static CoroutineHandle MEC.Timing.RunCoroutine ( IEnumerator< float >  coroutine)
inlinestatic

Run a new coroutine in the Update segment.

Parameters
coroutineThe new coroutine's handle.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutine() [2/4]

static CoroutineHandle MEC.Timing.RunCoroutine ( IEnumerator< float >  coroutine,
Segment  segment 
)
inlinestatic

Run a new coroutine.

Parameters
coroutineThe new coroutine's handle.
segmentThe segment that the coroutine should run in.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutine() [3/4]

static CoroutineHandle MEC.Timing.RunCoroutine ( IEnumerator< float >  coroutine,
Segment  segment,
string  tag 
)
inlinestatic

Run a new coroutine.

Parameters
coroutineThe new coroutine's handle.
segmentThe segment that the coroutine should run in.
tagAn optional tag to attach to the coroutine which can later be used for Kill operations.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutine() [4/4]

static CoroutineHandle MEC.Timing.RunCoroutine ( IEnumerator< float >  coroutine,
string  tag 
)
inlinestatic

Run a new coroutine in the Update segment.

Parameters
coroutineThe new coroutine's handle.
tagAn optional tag to attach to the coroutine which can later be used for Kill operations.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutineOnInstance() [1/4]

CoroutineHandle MEC.Timing.RunCoroutineOnInstance ( IEnumerator< float >  coroutine)
inline

Run a new coroutine on this Timing instance in the Update segment.

Parameters
coroutineThe new coroutine's handle.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutineOnInstance() [2/4]

CoroutineHandle MEC.Timing.RunCoroutineOnInstance ( IEnumerator< float >  coroutine,
Segment  segment 
)
inline

Run a new coroutine on this Timing instance.

Parameters
coroutineThe new coroutine's handle.
segmentThe segment that the coroutine should run in.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutineOnInstance() [3/4]

CoroutineHandle MEC.Timing.RunCoroutineOnInstance ( IEnumerator< float >  coroutine,
Segment  segment,
string  tag 
)
inline

Run a new coroutine on this Timing instance.

Parameters
coroutineThe new coroutine's handle.
segmentThe segment that the coroutine should run in.
tagAn optional tag to attach to the coroutine which can later be used for Kill operations.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ RunCoroutineOnInstance() [4/4]

CoroutineHandle MEC.Timing.RunCoroutineOnInstance ( IEnumerator< float >  coroutine,
string  tag 
)
inline

Run a new coroutine on this Timing instance in the Update segment.

Parameters
coroutineThe new coroutine's handle.
tagAn optional tag to attach to the coroutine which can later be used for Kill operations.
Returns
The coroutine's handle, which can be used for Wait and Kill operations.

◆ UnlockCoroutine()

bool MEC.Timing.UnlockCoroutine ( CoroutineHandle  coroutine,
CoroutineHandle  key 
)
inline

Unlocks a coroutine that has been locked, so long as the key matches.

Parameters
coroutineThe handle to the coroutine to be unlocked.
keyThe key that the coroutine was previously locked with.
Returns
Whether the coroutine was successfully unlocked.

◆ WaitForSeconds()

static float MEC.Timing.WaitForSeconds ( float  waitTime)
inlinestatic

Use "yield return Timing.WaitForSeconds(time);" to wait for the specified number of seconds.

Parameters
waitTimeNumber of seconds to wait.

◆ WaitForSecondsOnInstance()

float MEC.Timing.WaitForSecondsOnInstance ( float  waitTime)
inline

Use "yield return timingInstance.WaitForSecondsOnInstance(time);" to wait for the specified number of seconds.

Parameters
waitTimeNumber of seconds to wait.

◆ WaitUntilDone() [1/5]

static float MEC.Timing.WaitUntilDone ( AsyncOperation  operation)
inlinestatic

Use the command "yield return Timing.WaitUntilDone(operation);" to pause the current coroutine until the operation is done.

Parameters
operationThe operation variable returned.

◆ WaitUntilDone() [2/5]

static float MEC.Timing.WaitUntilDone ( CoroutineHandle  otherCoroutine)
inlinestatic

Use the command "yield return Timing.WaitUntilDone(otherCoroutine);" to pause the current coroutine until otherCoroutine is done.

Parameters
otherCoroutineThe coroutine to pause for.

◆ WaitUntilDone() [3/5]

static float MEC.Timing.WaitUntilDone ( CoroutineHandle  otherCoroutine,
bool  warnOnIssue 
)
inlinestatic

Use the command "yield return Timing.WaitUntilDone(otherCoroutine, false);" to pause the current coroutine until otherCoroutine is done, supressing warnings.

Parameters
otherCoroutineThe coroutine to pause for.
warnOnIssuePost a warning to the console if no hold action was actually performed.

◆ WaitUntilDone() [4/5]

static float MEC.Timing.WaitUntilDone ( CustomYieldInstruction  operation)
inlinestatic

Use the command "yield return Timing.WaitUntilDone(operation);" to pause the current coroutine until the operation is done.

Parameters
operationThe operation variable returned.

◆ WaitUntilDone() [5/5]

static float MEC.Timing.WaitUntilDone ( WWW  wwwObject)
inlinestatic

Use the command "yield return Timing.WaitUntilDone(wwwObject);" to pause the current coroutine until the wwwObject is done.

Parameters
wwwObjectThe www object to pause for.

The documentation for this class was generated from the following file: