docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class MarsRuntimeUtils

    Utility methods for the MARS Runtime

    Inheritance
    object
    MarsRuntimeUtils
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.MARS.MARSUtils
    Assembly: Unity.MARS.dll
    Syntax
    [MovedFrom("Unity.MARS")]
    public static class MarsRuntimeUtils

    Methods

    GetActiveCamera(bool)

    If simulating in edit mode, returns the simulated camera else returns the camera associated to the MarsSession through the MarsCamera camera reference.

    Declaration
    public static Camera GetActiveCamera(bool findFallbackCamera = false)
    Parameters
    Type Name Description
    bool findFallbackCamera

    If the active session camera is null, then it will try and return the main camera and if that is null will find a Camera object.

    Returns
    Type Description
    Camera

    The active mars camera.

    GetMarsSessionInActiveScene()

    Returns the first MarsSession found in the active scene

    Declaration
    public static MARSSession GetMarsSessionInActiveScene()
    Returns
    Type Description
    MARSSession

    The first MarsSession found in the active scene, or null if none exists

    GetMarsSessionInScene(Scene)

    Returns the first MarsSession found in the given scene

    Declaration
    public static MARSSession GetMarsSessionInScene(Scene scene)
    Parameters
    Type Name Description
    Scene scene

    The scene to search

    Returns
    Type Description
    MARSSession

    The first MarsSession found in the given scene, or null if none exists

    GetSessionAssociatedCamera(bool)

    Returns the camera associated to the MARS Session through the MarsCamera camera reference.

    Declaration
    public static Camera GetSessionAssociatedCamera(bool findFallbackCamera = false)
    Parameters
    Type Name Description
    bool findFallbackCamera

    If the active session camera is null, then it will try and return the main camera and if that is null will find a Camera object.

    Returns
    Type Description
    Camera

    The camera associated with the MARS Session

    HasMarsBehaviors(Scene)

    Checks if the given scene contains any MARS behaviors

    Declaration
    public static bool HasMarsBehaviors(Scene scene)
    Parameters
    Type Name Description
    Scene scene

    The scene to check

    Returns
    Type Description
    bool

    True if the scene has any MARS behaviors, false otherwise

    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)