Class SimulationSceneModule
Maintains a preview scene that the MARS Environment Manager uses to hold the environment objects and simulation query objects.
Inherited Members
Namespace: UnityEditor.MARS.Simulation
Assembly: Unity.MARS.Editor.dll
Syntax
[ModuleOrder(1073741824)]
[ModuleUnloadOrder(1073741824)]
[ModuleBehaviorCallbackOrder(1073741824)]
[MovedFrom("Unity.MARS")]
public class SimulationSceneModule : IModuleDependency<MARSSceneModule>, IModuleBehaviorCallbacks, IModule
Properties
ContentRoot
Root game object in the Content Scene.
Declaration
public GameObject ContentRoot { get; }
Property Value
Type | Description |
---|---|
GameObject |
ContentScene
The preview scene being used by the Simulation View to render simulated content objects.
Declaration
public Scene ContentScene { get; }
Property Value
Type | Description |
---|---|
Scene |
EnvironmentRoot
Root game object in the Environment Scene.
Declaration
public GameObject EnvironmentRoot { get; }
Property Value
Type | Description |
---|---|
GameObject |
EnvironmentScene
The preview scene being used by the Simulation View to render the simulated environment.
Declaration
public Scene EnvironmentScene { get; }
Property Value
Type | Description |
---|---|
Scene |
IsSimulationReady
Is the simulation scene open and ready to be used.
Declaration
public bool IsSimulationReady { get; }
Property Value
Type | Description |
---|---|
bool |
UsingSimulation
Are there any simulation scene users.
Declaration
public static bool UsingSimulation { get; }
Property Value
Type | Description |
---|---|
bool |
instance
Current instance of the SimulationSceneModule
Declaration
public static SimulationSceneModule instance { get; }
Property Value
Type | Description |
---|---|
SimulationSceneModule |
isAssemblyReloading
Are the assemblies being reloaded
Declaration
public static bool isAssemblyReloading { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddContentGameObject(GameObject, bool)
Moves a GameObject to the simulated content scene
Declaration
public void AddContentGameObject(GameObject go, bool keepAtRoot = false)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | The GameObject to move |
bool | keepAtRoot | Will keep the object at the root level of the simulated content scene otherwise it will be added the simulated content scene root object. |
AddEnvironmentGameObject(GameObject, bool)
Moves a GameObject to the simulated Environment scene
Declaration
public void AddEnvironmentGameObject(GameObject go, bool keepAtRoot = false)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | The GameObject to move |
bool | keepAtRoot | Will keep the object at the root level of the simulated environment scene otherwise it will be added the simulated environment scene root object. |
AssignCameraToSimulation(Camera)
Assigns a camera to a simulation with proper settings to render that view.
Declaration
public void AssignCameraToSimulation(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | Camera to render a simulation scene |
CloseSimulation()
Closes the current simulation scene without changing if any objects are using the simulation scene
Declaration
public void CloseSimulation()
ContainsSimulationUser(ScriptableObject)
Is the Scriptable Object assigned as a user of the Simulation Scene
Declaration
public static bool ContainsSimulationUser(ScriptableObject user)
Parameters
Type | Name | Description |
---|---|---|
ScriptableObject | user | The object to check if using |
Returns
Type | Description |
---|---|
bool | True if the object is using the simulation scene |
IsCameraAssignedToSimulationScene(Camera)
Checks whether the camera is assigned to the simulation.
Declaration
public bool IsCameraAssignedToSimulationScene(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | Camera to check if is assigned to the simulation. |
Returns
Type | Description |
---|---|
bool |
|
RegisterSimulationUser(ScriptableObject)
Adds an object to the simulation scene users and opens the simulation scene if it is not already open
Declaration
public void RegisterSimulationUser(ScriptableObject user)
Parameters
Type | Name | Description |
---|---|---|
ScriptableObject | user | The object using the simulation scene |
RemoveCameraFromSimulation(Camera)
Camera to be removed from rendering a simulation.
Declaration
public void RemoveCameraFromSimulation(Camera camera)
Parameters
Type | Name | Description |
---|---|---|
Camera | camera | Camera to stop rendering the simulation scene |
UnregisterSimulationUser(ScriptableObject)
Removes an object from the simulation scene users. If there are no users after this removal then the simulation scene is closed.
Declaration
public void UnregisterSimulationUser(ScriptableObject user)
Parameters
Type | Name | Description |
---|---|---|
ScriptableObject | user | The object no longer using the simulation scene |
Events
SimulationSceneClosing
Callback for when a simulation scene is closing.
Declaration
public static event Action SimulationSceneClosing
Event Type
Type | Description |
---|---|
Action |
SimulationSceneOpened
Callback for when a simulation scene is opened.
Declaration
public static event Action SimulationSceneOpened
Event Type
Type | Description |
---|---|
Action |