Class EasyARSettings.UnityXROptions
- 命名空间
- easyar
- 程序集
- EasyAR.Sense.dll
与Unity XR Framework相关的配置项。
[Serializable]
public class EasyARSettings.UnityXROptions
- 继承
-
EasyARSettings.UnityXROptions
字段
ARFoundationSupport
EasyAR AR Foundation支持。建议常开否则使用ARFoundation时EasyAR可能无法正常工作。仅建议在未来AR Foundation更新产生不兼容且EasyAR暂未推出更新时关闭。
[Tooltip("EasyAR AR Foundation Support. It is recommended to keep this enabled; otherwise, EasyAR may not work properly with AR Foundation. Disable only if a future AR Foundation update causes incompatibility and EasyAR has not yet provided an update.")]
public bool ARFoundationSupport
UnityXRAutoSwitch
自动切换Unity XR(比如AR Foundation)物体。这个选项主要为移动AR设计,头显上默认配置下功能会被禁用。
如果你需要自己控制这些组件的切换,或是EasyAR的行为干扰了某些组件的正常工作,请确保关闭这些选项。
如果你需要在运行时自动切换AR Foundation,你需要通过Unity的右键菜单在场景中创建AR Foundation的 `ARSession` 及 `XR Origin` ,并使用AR Foundation的相机。
运行时,ARSession会在awake时禁用所有Unity XR Core组件及AR Foundation的组件。
运行时,如果被选择的frame source继承自ARFoundationFrameSource或是实现了XROrigin原点的ExternalDeviceFrameSource,则被禁用的Unity XR Core组件及AR Foundation组件将在StartSession()时启用(未被EasyAR禁用的不会启用)。如果其他frame source被选择,则在StartSession()时会禁用所有Unity XR Core组件及AR Foundation的组件。
运行时,所有Unity XR Core组件及AR Foundation的组件会在StopSession(bool)时禁用。
需要注意,XR Interaction Toolkit的组件不受该选项控制,但其在EasyAR中是否可用未经验证。理论上对于只使用XROrigin GameObject和其Camera的功能应该可以正常使用,但你可能需要设置CenterMode为SessionOrigin。如果功能不正常,你需要自己管理XR Interaction Toolkit的组件,在frame source不是继承自ARFoundationFrameSource时禁用相关组件。
[Tooltip("Auto switch Unity XR (like AR Foundation) objects. This option is primarily designed for mobile AR. On head-mounted devices, the feature will be disabled by default. If you need to manually control the switching of these components, or if EasyAR's behavior interferes with the normal operation of certain components, make sure to disable these options. Please read API documents for more details.")]
public EasyARSettings.UnityXROptions.AutoSwitchOptions UnityXRAutoSwitch