docs.unity3d.com
    显示 / 隐藏目录

    Class SimulationSceneModule

    Maintains a preview scene that the MARS Environment Manager uses to hold the environment objects and simulation query objects.

    Inheritance
    Object
    SimulationSceneModule
    Namespace: Unity.MARS
    Syntax
    [ModuleOrder(1073741824)]
    [ModuleUnloadOrder(1073741824)]
    [ModuleBehaviorCallbackOrder(1073741824)]
    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

    instance

    Declaration
    public static SimulationSceneModule instance { get; }
    Property Value
    Type Description
    SimulationSceneModule

    isAssemblyReloading

    Declaration
    public static bool isAssemblyReloading { get; }
    Property Value
    Type Description
    Boolean

    IsSimulationReady

    Is the simulation scene open and ready to be used.

    Declaration
    public bool IsSimulationReady { get; }
    Property Value
    Type Description
    Boolean

    UsingSimulation

    Are there any simulation scene users.

    Declaration
    public static bool UsingSimulation { get; }
    Property Value
    Type Description
    Boolean

    Methods

    AddContentGameObject(GameObject, Boolean)

    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

    Boolean 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, Boolean)

    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

    Boolean 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()

    ConnectDependency(MARSSceneModule)

    Declaration
    public void ConnectDependency(MARSSceneModule dependency)
    Parameters
    Type Name Description
    MARSSceneModule dependency
    Implements
    IModuleDependency<T>.ConnectDependency(T)

    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
    Boolean

    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
    Boolean

    True is camera is assigned to the simulation.

    LoadModule()

    Declaration
    public void LoadModule()
    Implements
    IModule.LoadModule()

    OnBehaviorAwake()

    Declaration
    public void OnBehaviorAwake()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorAwake()

    OnBehaviorDestroy()

    Declaration
    public void OnBehaviorDestroy()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorDestroy()

    OnBehaviorDisable()

    Declaration
    public void OnBehaviorDisable()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorDisable()

    OnBehaviorEnable()

    Declaration
    public void OnBehaviorEnable()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorEnable()

    OnBehaviorStart()

    Declaration
    public void OnBehaviorStart()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorStart()

    OnBehaviorUpdate()

    Declaration
    public void OnBehaviorUpdate()
    Implements
    IModuleBehaviorCallbacks.OnBehaviorUpdate()

    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

    UnloadModule()

    Declaration
    public void UnloadModule()
    Implements
    IModule.UnloadModule()

    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
    返回到顶部
    Copyright © 2023 Unity Technologies — 商标和使用条款
    • 法律条款
    • 隐私政策
    • Cookie
    • 不要出售或分享我的个人信息
    • Your Privacy Choices (Cookie Settings)