Class MARSEnvironmentManager
Module responsible for setting up and switching between simulation environments of different types
Inheritance
MARSEnvironmentManager
Syntax
public class MARSEnvironmentManager : EditorScriptableSettings<MARSEnvironmentManager>, IModuleDependency<SimulationRecordingManager>, IModuleDependency<QuerySimulationModule>, IModuleDependency<SimulationSceneModule>, IModuleDependency<MARSWorldScaleModule>, IModuleDependency<FunctionalityInjectionModule>, IModuleDependency<SimulatedObjectsManager>, IModuleDependency<SimulationVideoContextManager>, IModule, IProvidesDeviceSimulationSettings, IFunctionalityProvider
Fields
EnvironmentLabel
Asset label used to collect environment prefabs
Declaration
public const string EnvironmentLabel = "Environment"
Field Value
Properties
CurrentLoadedPrefabInstanceEnvironment
Declaration
public GameObject CurrentLoadedPrefabInstanceEnvironment { get; }
Property Value
Type |
Description |
GameObject |
|
CurrentSyntheticEnvironmentIndex
Index of the currently active synthetic environment in the m_EnvironmentPrefabsPaths list
Declaration
public int CurrentSyntheticEnvironmentIndex { get; }
Property Value
CustomModeSettings
Declaration
public SimulationEnvironmentModeSettings CustomModeSettings { get; }
Property Value
DefaultDeviceStartingPose
Declaration
public Pose DefaultDeviceStartingPose { get; }
Property Value
DeviceStartingPose
Declaration
public Pose DeviceStartingPose { get; }
Property Value
Implements
EnvironmentBounds
Declaration
public Bounds EnvironmentBounds { get; }
Property Value
Implements
EnvironmentParent
The root object that environment objects are added to
Declaration
public GameObject EnvironmentParent { get; }
Property Value
Type |
Description |
GameObject |
|
EnvironmentSetup
Whether there is currently a simulation environment setup
Declaration
public bool EnvironmentSetup { get; }
Property Value
HasCustomModeSettings
Declaration
public bool HasCustomModeSettings { get; }
Property Value
IsFramingEnabled
Declaration
public bool IsFramingEnabled { get; }
Property Value
IsMovementEnabled
Declaration
public bool IsMovementEnabled { get; }
Property Value
Implements
ModeTypes
Declaration
public static GUIContent[] ModeTypes { get; }
Property Value
Type |
Description |
GUIContent[] |
|
SyntheticEnvironmentName
Name of the current synthetic environment prefab
Declaration
public string SyntheticEnvironmentName { get; }
Property Value
SyntheticEnvironmentsExist
Checks whether any synthetic environment prefab have been found
Declaration
public bool SyntheticEnvironmentsExist { get; }
Property Value
VoxelSizeFromEnvironment
Declaration
public float? VoxelSizeFromEnvironment { get; }
Property Value
Implements
Methods
ConnectDependency(QuerySimulationModule)
Declaration
public void ConnectDependency(QuerySimulationModule dependency)
Parameters
Implements
ConnectDependency(SimulatedObjectsManager)
Declaration
public void ConnectDependency(SimulatedObjectsManager dependency)
Parameters
Implements
ConnectDependency(SimulationRecordingManager)
Declaration
public void ConnectDependency(SimulationRecordingManager dependency)
Parameters
Implements
ConnectDependency(SimulationSceneModule)
Declaration
public void ConnectDependency(SimulationSceneModule dependency)
Parameters
Implements
Declaration
public void ConnectDependency(FunctionalityInjectionModule dependency)
Parameters
Implements
ConnectSubscriber(Object)
Declaration
public void ConnectSubscriber(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Implements
ForceSetupNextEnvironment(Boolean)
Sets up the next environment of the current type without the option to save environment changes.
Declaration
public void ForceSetupNextEnvironment(bool forward)
Parameters
Type |
Name |
Description |
Boolean |
forward |
Direction in which to cycle through environments
|
LoadModule()
Declaration
Implements
LoadProvider()
Declaration
public void LoadProvider()
Implements
SetEnvironmentInfo(MARSEnvironmentInfo)
Declaration
public void SetEnvironmentInfo(MARSEnvironmentInfo environmentInfo)
Parameters
TryFrameAllSimViewsOnEnvironment()
Declaration
public void TryFrameAllSimViewsOnEnvironment()
TryFrameSimViewOnEnvironment(ISimulationView, Boolean, Boolean)
Declaration
public Quaternion TryFrameSimViewOnEnvironment(ISimulationView simView, bool rotateView, bool instant)
Parameters
Returns
Type |
Description |
Quaternion |
|
TrySaveEnvironmentModificationsDialog(Boolean)
Brings up the save simulated environment dialog if there are changes that are not
ignored due to properties that the simulation controls.
Declaration
public bool TrySaveEnvironmentModificationsDialog(bool cancelable = true)
Parameters
Type |
Name |
Description |
Boolean |
cancelable |
Is the operation that caused the save dialog cancelable.
|
Returns
Type |
Description |
Boolean |
Returns true if the dialog was completed without canceling.
|
TrySetupEnvironmentAndRestartSimulation(Int32)
Sets up the specified environment based on index in environment list of the current type and then
triggers simulation restart.
Declaration
public bool TrySetupEnvironmentAndRestartSimulation(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
Specified index of environment
|
Returns
Type |
Description |
Boolean |
If True, setup of the environment was not canceled.
|
TrySetupNextEnvironmentAndRestartSimulation(Boolean)
Sets up the next environment of the current type and then triggers simulation restart after a save dialog
if there are any saveable changes in the environment.
Declaration
public bool TrySetupNextEnvironmentAndRestartSimulation(bool forward)
Parameters
Type |
Name |
Description |
Boolean |
forward |
Direction in which to cycle through environments
|
Returns
Type |
Description |
Boolean |
If True, setup of environment and restart was not canceled.
|
UnloadModule()
Declaration
public void UnloadModule()
Implements
UnloadProvider()
Declaration
public void UnloadProvider()
Implements
UpdateSimulatedEnvironmentCandidates()
Declaration
public void UpdateSimulatedEnvironmentCandidates()
Declaration
public static void UpdateSimulationEnvironmentsMenuItem()
Events
EnvironmentChanged
Declaration
public event Action EnvironmentChanged
Event Type
Implements
onEnvironmentSetup
Declaration
public static event Action onEnvironmentSetup
Event Type
Explicit Interface Implementations
Declaration
void IModuleDependency<MARSWorldScaleModule>.ConnectDependency(MARSWorldScaleModule dependency)
Parameters
Implements
IModuleDependency<SimulationVideoContextManager>.ConnectDependency(SimulationVideoContextManager)
Declaration
void IModuleDependency<SimulationVideoContextManager>.ConnectDependency(SimulationVideoContextManager dependency)
Parameters
Type |
Name |
Description |
Unity.MARS.Simulation.SimulationVideoContextManager |
dependency |
|
Implements