static void Register() { if (!Api.AtLeast13_0()) { return; } const string k_SubsystemId = "ARKit-HumanBody"; XRHumanBodySubsystemCinfo humanBodySubsystemCinfo = new XRHumanBodySubsystemCinfo() { id = k_SubsystemId, #if UNITY_2020_2_OR_NEWER providerType = typeof(ARKitHumanBodySubsystem.ARKitProvider), subsystemTypeOverride = typeof(ARKitHumanBodySubsystem), #else implementationType = typeof(ARKitHumanBodySubsystem), #endif supportsHumanBody2D = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose2DEstimation(), supportsHumanBody3D = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose3DEstimation(), supportsHumanBody3DScaleEstimation = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose3DScaleEstimation(), }; XRHumanBodySubsystem.Register(humanBodySubsystemCinfo); }
static void Register() { #if UNITY_EDITOR const string k_SubsystemId = "ARKit-HumanBody-Remote"; XRHumanBodySubsystemCinfo info = new XRHumanBodySubsystemCinfo() { id = k_SubsystemId, implementationType = typeof(ARKitHumanBodyRemoteSubsystem), supportsHumanBody2D = false, supportsHumanBody3D = false, supportsHumanBody3DScaleEstimation = false, supportsHumanStencilImage = true, supportsHumanDepthImage = true, }; if (!XRHumanBodySubsystem.Register(info)) { Debug.LogErrorFormat("Cannot register the {0} subsystem", k_SubsystemId); } else { Debug.LogFormat("Registered the {0} subsystem", k_SubsystemId); } #endif // UNITY_EDITOR }
static void Register() { #if UNITY_IOS && !UNITY_EDITOR const string k_SubsystemId = "ARKit-HumanBody"; bool supportsBodyPoseEstimation = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPoseEstimation(); bool supportsBodySegmentationStencil = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodySegmentationStencil(); bool supportsBodySegmentationDepth = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodySegmentationDepth(); XRHumanBodySubsystemCinfo humanBodySubsystemCinfo = new XRHumanBodySubsystemCinfo() { id = k_SubsystemId, implementationType = typeof(ARKitHumanBodySubsystem), supportsHumanBody2D = supportsBodyPoseEstimation, supportsHumanBody3D = supportsBodyPoseEstimation, supportsHumanStencilImage = supportsBodySegmentationStencil, supportsHumanDepthImage = supportsBodySegmentationDepth, }; if (!XRHumanBodySubsystem.Register(humanBodySubsystemCinfo)) { Debug.LogErrorFormat("Cannot register the {0} subsystem", k_SubsystemId); } #endif }
static void Register() { #if UNITY_IOS && !UNITY_EDITOR const string k_SubsystemId = "ARKit-HumanBody"; XRHumanBodySubsystemCinfo humanBodySubsystemCinfo = new XRHumanBodySubsystemCinfo() { id = k_SubsystemId, implementationType = typeof(ARKitHumanBodySubsystem), supportsHumanBody2D = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose2DEstimation(), supportsHumanBody3D = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose3DEstimation(), supportsHumanBody3DScaleEstimation = NativeApi.UnityARKit_HumanBodyProvider_DoesSupportBodyPose3DScaleEstimation(), }; if (!XRHumanBodySubsystem.Register(humanBodySubsystemCinfo)) { Debug.LogErrorFormat("Cannot register the {0} subsystem", k_SubsystemId); } #endif }
static void Register() { #if UNITY_EDITOR const string id = "ARKit-HumanBody-Remote"; XRHumanBodySubsystemCinfo humanBodySubsystemCinfo = new XRHumanBodySubsystemCinfo() { id = id, implementationType = typeof(ARKitHumanBodyRemoteSubsystem), supportsHumanBody2D = true, supportsHumanBody3D = true, supportsHumanBody3DScaleEstimation = true, }; if (XRHumanBodySubsystem.Register(humanBodySubsystemCinfo)) { Debug.LogFormat("Registerd the {0} subsystem", id); } else { Debug.LogErrorFormat("Cannot register the {0} subsystem", id); } #endif // UNITY_EDITOR }