docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MARSEnvironmentManager

    Module responsible for setting up and switching between simulation environments of different types.

    Inheritance
    object
    Object
    ScriptableObject
    ScriptableSettingsBase
    ScriptableSettingsBase<MARSEnvironmentManager>
    EditorScriptableSettings<MARSEnvironmentManager>
    MARSEnvironmentManager
    Implements
    IModuleDependency<SimulationRecordingManager>
    IModuleDependency<QuerySimulationModule>
    IModuleDependency<SimulationSceneModule>
    IModuleDependency<MarsWorldScaleModule>
    IModuleDependency<FunctionalityInjectionModule>
    IModuleDependency<SimulatedObjectsManager>
    IModuleDependency<SimulationVideoContextManager>
    IModule
    IProvidesDeviceSimulationSettings
    IFunctionalityProvider
    Inherited Members
    EditorScriptableSettings<MARSEnvironmentManager>.instance
    ScriptableSettingsBase<MARSEnvironmentManager>.k_HasCustomPath
    ScriptableSettingsBase<MARSEnvironmentManager>.s_Instance
    ScriptableSettingsBase<MARSEnvironmentManager>.Save(string)
    ScriptableSettingsBase<MARSEnvironmentManager>.GetFilePath()
    ScriptableSettingsBase.k_PathExceptionMessage
    ScriptableSettingsBase.GetInstanceByType(Type)
    ScriptableSettingsBase.OnLoaded()
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEditor.MARS.Simulation
    Assembly: Unity.MARS.Editor.dll
    Syntax
    [ScriptableSettingsPath("Assets/MARS/Settings")]
    [MovedFrom("Unity.MARS")]
    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
    Type Description
    string

    Properties

    CurrentLoadedPrefabInstanceEnvironment

    The currently loaded synthetic environment mode prefab instance

    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
    Type Description
    int

    CustomModeSettings

    The custom mode settings assigned to the environment manager

    Declaration
    public SimulationEnvironmentModeSettings CustomModeSettings { get; }
    Property Value
    Type Description
    SimulationEnvironmentModeSettings

    DefaultDeviceStartingPose

    The default device starting pose for a synthetic environment

    Declaration
    public Pose DefaultDeviceStartingPose { get; }
    Property Value
    Type Description
    Pose

    DeviceStartingPose

    The pose of the device when a simulation starts

    Declaration
    public Pose DeviceStartingPose { get; }
    Property Value
    Type Description
    Pose

    EnvironmentBounds

    Bounds encapsulating the whole environment

    Declaration
    public Bounds EnvironmentBounds { get; }
    Property Value
    Type Description
    Bounds

    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
    Type Description
    bool

    HasCustomModeSettings

    Does the environment manager have a custom mode assigned

    Declaration
    public bool HasCustomModeSettings { get; }
    Property Value
    Type Description
    bool

    IsFramingEnabled

    Is framing the simulation from a simulation view enabled in the current environment and mode

    Declaration
    public bool IsFramingEnabled { get; }
    Property Value
    Type Description
    bool

    IsMovementEnabled

    Is movement enabled in the current environment and mode

    Declaration
    public bool IsMovementEnabled { get; }
    Property Value
    Type Description
    bool

    ModeTypes

    Gui contents generated from the available EnvironmentModes

    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
    Type Description
    string

    SyntheticEnvironmentsExist

    Checks whether any synthetic environment prefab have been found

    Declaration
    public bool SyntheticEnvironmentsExist { get; }
    Property Value
    Type Description
    bool

    VoxelSizeFromEnvironment

    The voxel size of the PlaneExtractionSettings in the current environment

    Declaration
    public float? VoxelSizeFromEnvironment { get; }
    Property Value
    Type Description
    float?

    Methods

    ForceSetupNextEnvironment(bool)

    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
    bool forward

    Direction in which to cycle through environments

    SetEnvironmentInfo(MARSEnvironmentInfo)

    Sets the environment info in the environment manager for the synthetic environment

    Declaration
    public void SetEnvironmentInfo(MARSEnvironmentInfo environmentInfo)
    Parameters
    Type Name Description
    MARSEnvironmentInfo environmentInfo

    The new environment info to set in the manager

    TryFrameAllSimViewsOnEnvironment()

    Try to frame all the simulation views on the synthetic environment with the synthetic environment info

    Declaration
    public void TryFrameAllSimViewsOnEnvironment()

    TryFrameSimViewOnEnvironment(ISimulationView, bool)

    Try to frame the simulation view on the current environment, if possible

    Declaration
    public Quaternion TryFrameSimViewOnEnvironment(ISimulationView simView, bool instant)
    Parameters
    Type Name Description
    ISimulationView simView

    The simulation view which should be updated

    bool instant

    Whether to update the view instantly or with an animated transition

    Returns
    Type Description
    Quaternion

    The rotation of the simulation view camera once the view is framed

    TryFrameSimViewOnEnvironment(ISimulationView, bool, bool)

    Try to frame the simulation view on the current environment, if possible

    Declaration
    [Obsolete("The rotateView parameter of TryFrameSimViewOnEnvironment is obsolete; Use the overload with two parameters")]
    public Quaternion TryFrameSimViewOnEnvironment(ISimulationView simView, bool rotateView, bool instant)
    Parameters
    Type Name Description
    ISimulationView simView

    The simulation view which should be updated

    bool rotateView

    Whether to rotate the view as well as translate it

    bool instant

    Whether to update the view instantly or with an animated transition

    Returns
    Type Description
    Quaternion

    The rotation of the simulation view camera once the view is framed

    TrySaveEnvironmentModificationsDialog(bool)

    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
    bool cancelable

    Is the operation that caused the save dialog cancelable.

    Returns
    Type Description
    bool

    Returns true if the dialog was completed without canceling.

    TrySetupEnvironmentAndRestartSimulation(int)

    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
    int index

    Specified index of environment

    Returns
    Type Description
    bool

    If True, setup of the environment was not canceled.

    TrySetupNextEnvironmentAndRestartSimulation(bool)

    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
    bool forward

    Direction in which to cycle through environments

    Returns
    Type Description
    bool

    If True, setup of environment and restart was not canceled.

    UpdateSimulatedEnvironmentCandidates()

    Update the Simulated Environments available in Synthetic Simulation

    Declaration
    public void UpdateSimulatedEnvironmentCandidates()

    UpdateSimulationEnvironmentsMenuItem()

    Update the Simulated Environments available in Synthetic Simulation

    Declaration
    [MenuItem("Window/MARS/Developer/Update Simulation Environments", priority = 2095)]
    public static void UpdateSimulationEnvironmentsMenuItem()

    Events

    EnvironmentChanged

    Event callback for when the simulated environment has changed

    Declaration
    public event Action EnvironmentChanged
    Event Type
    Type Description
    Action

    onEnvironmentSetup

    Called when the simulated environment is setup and calls

    EditorOnlyEvents.OnEnvironmentSetup
    Declaration
    public static event Action onEnvironmentSetup
    Event Type
    Type Description
    Action

    Implements

    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModuleDependency<T>
    Unity.XRTools.ModuleLoader.IModule
    IProvidesDeviceSimulationSettings
    Unity.XRTools.ModuleLoader.IFunctionalityProvider
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)