Class ARSession
Controls the lifecycle and configuration options for an AR session. There is only one active session. If you have multiple ARSession components, they all talk to the same session and will conflict with each other.
Enabling or disabling the ARSession will start or stop the session, respectively.
Inheritance
Namespace: UnityEngine.XR.ARFoundation
Syntax
public class ARSession : MonoBehaviour
Properties
lightEstimation
When enabled, requests that light estimation information be made available. Not all AR devices support light estimation.
Declaration
public bool lightEstimation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
persistBetweenScenes
Get or set the persistence of this session across scenes.
Declaration
public bool persistBetweenScenes { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
If the ARSession is not persisted between scenes, then it
will be destroyed during a scene change, and you may lose any detected
features in the environment, such as planar surfaces. This may be undesirable,
so you can keep the session alive by setting persistBetweenScenes
to true
. If you do this, you should not have an active ARSession
in the scene that gets loaded, or they could conflict with each other.
tryToInstallUpdateIfNeeded
If the device supports AR but does not have the necessary software, some platforms
allow prompting the user to install or update the software. If tryToInstallUpdateIfNeeded
is true, a software update will be attempted. If the appropriate software is not installed
or out of date, and tryToInstallUpdateIfNeeded
is false
, then AR will not be available.
Declaration
public bool tryToInstallUpdateIfNeeded { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |