Class SimulatedObjectsManager
Module responsible for copying simulatable objects to the simulation scene, mapping between these copies and their originals, and checking for changes to the original objects
Inheritance
Implements
Inherited Members
Namespace: UnityEditor.MARS.Simulation
Assembly: Unity.MARS.Editor.dll
Syntax
[ScriptableSettingsPath("Assets/MARS/UserSettings")]
[MovedFrom("Unity.MARS")]
public class SimulatedObjectsManager : EditorScriptableSettings<SimulatedObjectsManager>, IModuleDependency<QuerySimulationModule>, IModuleDependency<MARSEnvironmentManager>, IModuleDependency<SimulationSceneModule>, IModuleDependency<SceneWatchdogModule>, IModule
Fields
SimulatedObjectHideFlags
Hide flags for game objects in the simulated content scene
Declaration
public const HideFlags SimulatedObjectHideFlags = DontSave
Field Value
| Type | Description |
|---|---|
| HideFlags |
Properties
SimulatableBehavioursBlockingResyncCount
Number of behaviours that are currently blocking auto resync
Declaration
public int SimulatableBehavioursBlockingResyncCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
SimulatedCamera
The copied MARS camera reference in the simulated content scene
Declaration
public Camera SimulatedCamera { get; }
Property Value
| Type | Description |
|---|---|
| Camera |
SimulatedContentRoot
The root object that simulated content copies are added to
Declaration
public GameObject SimulatedContentRoot { get; }
Property Value
| Type | Description |
|---|---|
| GameObject |
SimulationSyncedWithScene
Whether the simulated content reflects the state of the active scene
Declaration
public bool SimulationSyncedWithScene { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
AddSpawnedObjectToSimulation(GameObject)
Adds the given Game Object to the current simulation and starts running its ISimulatable behaviours
Declaration
public void AddSpawnedObjectToSimulation(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | gameObject | The Game Object to add to simulation |
DirtySimulatableScene()
Sets flags that the active scene has been modified and simulation should restart. This guarantees that the scene contents will be copied to the simulation scene for the next simulation.
Declaration
public void DirtySimulatableScene()
GetCopiedSimulatable(ISimulatable)
Returns the simulation scene copy of an ISimulatable, if there is one
Declaration
public ISimulatable GetCopiedSimulatable(ISimulatable original)
Parameters
| Type | Name | Description |
|---|---|---|
| ISimulatable | original | The original version of a copied ISimulatable |
Returns
| Type | Description |
|---|---|
| ISimulatable |
GetCopiedTransform(Transform)
Returns the simulation scene copy of a Transform, if there is one
Declaration
public Transform GetCopiedTransform(Transform original)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | original | The original version of a copied Transform |
Returns
| Type | Description |
|---|---|
| Transform |
GetOriginalObject(Object)
Returns the original scene copy of a simulation scene Object, if there is one being managed
Declaration
public Object GetOriginalObject(Object copy)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | copy | The copied version of an object |
Returns
| Type | Description |
|---|---|
| Object |
GetOriginalSimulatable(ISimulatable)
Returns the original version of an ISimulatable copied to the simulation scene, if there is one
Declaration
public ISimulatable GetOriginalSimulatable(ISimulatable copy)
Parameters
| Type | Name | Description |
|---|---|---|
| ISimulatable | copy | The ISimulatable in the simulation scene |
Returns
| Type | Description |
|---|---|
| ISimulatable | The original version of the copied object |
GetOriginalTransform(Transform)
Returns the original scene copy of a simulation scene Transform, if there is one
Declaration
public Transform GetOriginalTransform(Transform copy)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | copy | The copied version of a Transform |
Returns
| Type | Description |
|---|---|
| Transform |
IsSimulatedObject(GameObject)
Checks whether an object is a simulated object.
Declaration
public static bool IsSimulatedObject(GameObject obj)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | obj | The gameobject to check. |
Returns
| Type | Description |
|---|---|
| bool | True if the object is a simulated object |