Class MARSSession
Represents the runtime behavior of MARS. One of these must be in any scene with MARS content for it to function properly
Inherited Members
Namespace: Unity.MARS
Syntax
[HelpURL("https://docs.unity3d.com/Packages/com.unity.mars@1.5/manual/MARSConcepts.html#the-mars-session-and-the-camera")]
[AddComponentMenu("")]
public class MARSSession : MonoBehaviour, IUsesFunctionalityInjection, IFunctionalitySubscriber<IProvidesFunctionalityInjection>, IFunctionalitySubscriber
Fields
LicensingUrl
Declaration
public const string LicensingUrl = "https://www.unity.com/mars"
Field Value
Type | Description |
---|---|
String |
NotEntitledMessage
Declaration
public const string NotEntitledMessage = "No MARS subscription found for the current user. Users must purchase a subscription from the online store."
Field Value
Type | Description |
---|---|
String |
NotEntitledMessageWithUrl
Declaration
[Obsolete]
public const string NotEntitledMessageWithUrl = "No MARS subscription found for the current user. Users must purchase a subscription from the online store. Please go to https://www.unity.com/mars"
Field Value
Type | Description |
---|---|
String |
Properties
Instance
Currently active MARS session singleton instance
Declaration
public static MARSSession Instance { get; }
Property Value
Type | Description |
---|---|
MARSSession |
island
Active functionality island for the MARS session
Declaration
public FunctionalityIsland island { get; }
Property Value
Type | Description |
---|---|
FunctionalityIsland |
RequestedMaximumFaceCount
The maximum number of tracked faces requested by this session
Declaration
public int RequestedMaximumFaceCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
requirements
Functionality requirements for the MARS session
Declaration
public Capabilities requirements { get; }
Property Value
Type | Description |
---|---|
Capabilities |
Methods
CheckCapabilities()
Check the capabilities required in the MARS session
Declaration
public bool CheckCapabilities()
Returns
Type | Description |
---|---|
Boolean |
|
EnsureRuntimeState(Transform)
Ensures that a MARS Scene has all required components and configuration
Declaration
public static void EnsureRuntimeState(Transform overrideUserRef = null)
Parameters
Type | Name | Description |
---|---|---|
Transform | overrideUserRef | Override the creation of a new user prefab with an exiting one |
EnsureSessionInActiveScene()
Ensures that the active scene has a MARS Session
Declaration
public static MARSSession EnsureSessionInActiveScene()
Returns
Type | Description |
---|---|
MARSSession | Thew newly created MARSSession, or null if a session previously exists |
FindExistingInstance()
Search all loaded scenes for MARSSession objects and set the first one to the Instance property, if any exist
Declaration
public static void FindExistingInstance()
Explicit Interface Implementations
IFunctionalitySubscriber<IProvidesFunctionalityInjection>.provider
Declaration
IProvidesFunctionalityInjection IFunctionalitySubscriber<IProvidesFunctionalityInjection>.provider { get; set; }
Returns
Type | Description |
---|---|
IProvidesFunctionalityInjection |