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
SimulatedObjectsManager
Syntax
[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 = HideFlags.DontSaveInEditor | HideFlags.DontSaveInBuild | HideFlags.DontUnloadUnusedAsset | HideFlags.DontSave
Field Value
Properties
SimulatableBehavioursBlockingResyncCount
Number of behaviours that are currently blocking auto resync
Declaration
public int SimulatableBehavioursBlockingResyncCount { get; }
Property Value
SimulatedCamera
The copied MARS camera reference in the simulated content scene
Declaration
public Camera SimulatedCamera { get; }
Property Value
SimulatedContentRoot
The root object that simulated content copies are added to
Declaration
public GameObject SimulatedContentRoot { get; }
Property Value
SimulationSyncedWithScene
Whether the simulated content reflects the state of the active scene
Declaration
public bool SimulationSyncedWithScene { get; }
Property Value
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
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
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
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
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
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
Explicit Interface Implementations
Declaration
void IModule.LoadModule()
Implements
Declaration
void IModule.UnloadModule()
Implements
Declaration
void IModuleDependency<SceneWatchdogModule>.ConnectDependency(SceneWatchdogModule dependency)
Parameters
Implements
Declaration
void IModuleDependency<MARSEnvironmentManager>.ConnectDependency(MARSEnvironmentManager dependency)
Parameters
Implements
Declaration
void IModuleDependency<QuerySimulationModule>.ConnectDependency(QuerySimulationModule dependency)
Parameters
Implements
Declaration
void IModuleDependency<SimulationSceneModule>.ConnectDependency(SimulationSceneModule dependency)
Parameters
Implements