Class UnityTimeSensor
Inheritance
UnityTimeSensor
Assembly: Xareus.Unity.Librairies.dll
Syntax
[FunctionDescription("This time sensor precision depends on Unity's chosen time type : \n- Update and Unscaled are checked in Update\n- Physics and Unscaled_Physics are checked in Fixed Update\n- Realtime is checked in Update and Fixed Update and uses realtimeSinceStartup\nThis sensor forces the scenario to update when the time is elapsed, resulting in a more precise timing than with Xareus default time sensor")]
public class UnityTimeSensor : AUnitySensor
Constructors
UnityTimeSensor(Event, Dictionary<string, Parameter>, IContext, IContext, IContext)
Declaration
public UnityTimeSensor(Event @event, Dictionary<string, Parameter> parameters, IContext externalContext, IContext scenarioContext, IContext sequenceContext)
Parameters
Fields
KEY_TIME
Declaration
[EventContextEntry]
public static readonly string KEY_TIME
Field Value
Unit
time unit used (eg: second, minute)
Declaration
[ConfigurationParameter("unit", "time unit used (eg: second, minute, hour). default : second", Necessity.Optional)]
protected TimeUnit Unit
Field Value
eventContext
Declaration
protected SimpleDictionary eventContext
Field Value
expectedDateTime
When the sensor should trigger
Declaration
protected double expectedDateTime
Field Value
time
minimum time before triggering (in units).
Declaration
[ConfigurationParameter("minimum", "minimum time before triggering. The time is a lower bound. Real time depends on the scenario update frequency.", Necessity.Required)]
protected double time
Field Value
timeType
time unit used (eg: second, minute)
Declaration
[ConfigurationParameter("Time type", "Use Unscaled Time", Necessity.Required)]
protected UnityTimeSensor.TimeType timeType
Field Value
triggered
Declaration
Field Value
Properties
SensorInitializationTime
Declaration
public double SensorInitializationTime { get; protected set; }
Property Value
Methods
SafeReset()
Reset a sensor. Note that this code will be executed in unity's thread and the declared parameters (using the ConfigurationParameter attribute) are already filled
Declaration
public override void SafeReset()
Overrides
SafeSensorCheck()
This method is called at each scenario update. Note that this code will be executed in unity's thread
Declaration
public override ASensor.Result SafeSensorCheck()
Returns
Overrides
StopCheck()
Declaration
public override void StopCheck()
Overrides