DOCUMENTATION / UX PLATFORM
UX Platform
This system is responsible for showing/hiding, enabling/disabling, and initializing platform-specific systems like cameras, plane detection, controller inputs, etc. For example, if you need something to only exist when building to iOS, child the gameObject to the ARFoundation UXPlatform and UXPlatformManager will intelligently enable those gameObjects when ARFoundation is the ActivePlatform.
UXAppManager.cs
UXAppManager is a manager of managers. It’s only purpose is to ensure that when Awake is called, UXFoundation’s 5 system managers (UXPlatformManager, UXNetworkingManager, UXUIManager, UXDataManager, and UXSessionManager) are all initialized in the proper sequence.
UXPlatformManager.cs
Properties & Functions
UXPlatformController activePlatform;
The UXPlatformManager activates the UXPlatformController either matches automatically detected Build Settings platform or the one specified in OverridePlatform.
Inspector Tools
UXPlatformType overridePlatform;
This is a convenience tool that allows you to manually override the Build Platform that Unity automatically detects. Note: this is used during initialization so it must be set prior to runtime.
UXPlatformController.cs
Properties & Functions
UXPlatformType platformType;
Out of the box, we support: Editor, ARFoundation, and MRTK. This enables easy deployment to iOS, Android, HoloLens, and Quest. Other managers use this in combination with UXPlatformViewType to determine which environment, UI, camera, etc needs to be enabled/instantiated.
Tip: Adding a platform is as simple as 1) adding the name of the platform to the enum in UXPlatformManager, 2) duplicating an existing platform, 3) renaming it and selecting the new platform from the dropdown in the inspector, 4) adding your platform specific code.
UXPlatformViewType platformViewType;
Out of the box, we support: TwoD, WearableAR, WearableVR. Other UX managers use this in combination with UXPlatformType to determine which environment, UI, camera, etc needs to be enabled/instantiated.
UXDevice.cs
Properties & Functions
List<UXPlatformType> platformTypes;
When UXPlatformManager initializes the ActivePlatform, it does an app-wide search for UXDevice.cs components and enables/disables that gameObject based on whether or not the UXPlatformType is supported (read: added to the list).
UXPlaneManager.cs
This is a helper component attached to the ARFoundation UXPlatform gameObject that classifies planes as Ceiling/Wall/Floor and applies a contextual material.
Properties & Functions
Material ceiling
Public access to the ceiling material type that is applied to ARPlanes that are classified as a ceiling.
Material wall
Public access to the wall material type that is applied to ARPlanes that are classified as a wall.
Material floor
Public access to the floor material type that is applied to ARPlanes that are classified as a floor.