Class QuerySimulationModule
Module responsible for simulating queries in edit mode
Inheritance
Implements
Inherited Members
Namespace: UnityEditor.MARS.Simulation
Assembly: Unity.MARS.Editor.dll
Syntax
[ScriptableSettingsPath("Assets/MARS/Settings")]
[MovedFrom("Unity.MARS")]
public class QuerySimulationModule : EditorScriptableSettings<QuerySimulationModule>, IModuleDependency<MARSDatabase>, IModuleDependency<MARSQueryBackend>, IModuleDependency<ReasoningModule>, IModuleDependency<SlowTaskModule>, IModuleDependency<SimulatedObjectsManager>, IModuleDependency<MARSEnvironmentManager>, IModuleDependency<EvaluationSchedulerModule>, IModuleDependency<FunctionalityInjectionModule>, IModuleDependency<SimulationSceneModule>, IModuleDependency<SceneWatchdogModule>, IModuleDependency<QueryPipelinesModule>, IModule, IUsesDatabaseQuerying, IUsesCameraOffset, IFunctionalitySubscriber<IProvidesCameraOffset>, IFunctionalitySubscriber
Properties
providersRoot
Root game object for functionality providers created for simulation
Declaration
public GameObject providersRoot { get; }
Property Value
| Type | Description |
|---|---|
| GameObject |
sceneIsSimulatable
Whether the active scene can be simulated
Declaration
public static bool sceneIsSimulatable { get; }
Property Value
| Type | Description |
|---|---|
| bool |
simulatedDataAvailable
(Obsolete) Simulated data available
Declaration
[Obsolete("simulatedDataAvailable has been deprecated", true)]
public bool simulatedDataAvailable { get; }
Property Value
| Type | Description |
|---|---|
| bool |
simulating
Whether a simulation is currently running
Declaration
public bool simulating { get; }
Property Value
| Type | Description |
|---|---|
| bool |
simulatingTemporal
Whether a temporal simulation is currently running
Declaration
public bool simulatingTemporal { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
RequestSimulationModeSelection(SimulationModeSelection)
Request that the next simulation should run in either single-frame mode or temporal mode
Declaration
public void RequestSimulationModeSelection(SimulationModeSelection simModeSelection)
Parameters
| Type | Name | Description |
|---|---|---|
| SimulationModeSelection | simModeSelection | The requested mode selection method |
RestartSimulationIfNeeded(bool)
If any objects are using the simulation scene, this method sets a flag that a new simulation should happen as soon as possible
Declaration
public void RestartSimulationIfNeeded(bool stopSimulationImmediately = false)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | stopSimulationImmediately | If true and if temporal simulation is running, this method will immediately stop simulation. If TemporalMode has been requested for the next simulation then this method will invoke BeforeTemporalSimulationRestart before stopping simulation. |
SimulateOneShot()
Runs simulation over a single frame. This method repeatedly checks for query matches until there are no more to be found.
Declaration
public void SimulateOneShot()
StartTemporalSimulation()
Starts query simulation that runs frame-to-frame
Declaration
public void StartTemporalSimulation()
StopTemporalSimulation()
(Obsolete) Stops query simulation that runs frame-to-frame (Obsolete)
Declaration
[Obsolete("StopTemporalSimulation() has been deprecated because it does not fully reset the state of simulation. To stop temporal simulation and reset state, use RestartSimulationIfNeeded().", false)]
public void StopTemporalSimulation()
Events
BeforeCleanupProviders
Called right before simulation providers are destroyed
Declaration
public static event Action BeforeCleanupProviders
Event Type
| Type | Description |
|---|---|
| Action |
BeforeSimulationSetup
Called right before a simulation starts setting up
Declaration
public static event Action BeforeSimulationSetup
Event Type
| Type | Description |
|---|---|
| Action |
BeforeTemporalSimulationRestart
Called right before a temporal simulation ends and a new one starts
Declaration
public static event Action BeforeTemporalSimulationRestart
Event Type
| Type | Description |
|---|---|
| Action |
OnOneShotSimulationStart
Called right after a single-frame simulation has started
Declaration
public static event Action OnOneShotSimulationStart
Event Type
| Type | Description |
|---|---|
| Action |
addCustomProviders
Called right before default providers are setup when starting simulation. The list should be filled out with providers that you want this module to add before it sets up default providers. Provider game objects created in this callback should be created using GameObjectUtils.Create so that they get added to the simulation scene.
Declaration
public static event Action<List<IFunctionalityProvider>> addCustomProviders
Event Type
| Type | Description |
|---|---|
| Action<List<IFunctionalityProvider>> |
onTemporalSimulationStart
Called right after a temporal simulation has started
Declaration
public static event Action onTemporalSimulationStart
Event Type
| Type | Description |
|---|---|
| Action |
onTemporalSimulationStop
Called right after a temporal simulation has stopped
Declaration
public static event Action onTemporalSimulationStop
Event Type
| Type | Description |
|---|---|
| Action |
simulationDone
Called right after a single-frame simulation has stopped
Declaration
public static event Action simulationDone
Event Type
| Type | Description |
|---|---|
| Action |