Gravity Engine 12.0
Unity Asset for Gravity
|
Handle any GETrigger requests that have been registered with GE. More...
Classes | |
class | Trigger |
Public Member Functions | |
delegate bool | TriggerFunction (GravityState gs, System.Object data) |
Function to be run at each engineDt cycle. | |
GETriggerMgr (GETriggerMgr from) | |
void | AddTrigger (Trigger t) |
void | RemoveTrigger (Trigger t) |
void | Clear () |
bool | HaveTriggers () |
void | RunTriggers (GravityState gs) |
Run all the registered triggers. If any ask to be removed, take them out of the list. | |
Handle any GETrigger requests that have been registered with GE.
GETrigger allows user code to insert a condition check (e.g. is ship within 100 units of the target) into the main evolution loop of gravity engine. This is better than have user code check the condition itself in FixedUpdate if the time zoom capability is being used (then the time jumps per fixed update can be large). By using a GETrigger the condition is checked every engineDt cycle.
This does directly impact the time required by the core loop in GE.
If any triggers are present this also prevents the use of time jumps in all-on-rails cases.
A trigger consists of a delegate function and an opaque data reference.
void GETriggerMgr.RunTriggers | ( | GravityState | gs | ) |
Run all the registered triggers. If any ask to be removed, take them out of the list.
gs |
delegate bool GETriggerMgr.TriggerFunction | ( | GravityState | gs, |
System.Object | data | ||
) |
Function to be run at each engineDt cycle.
gs |