コード例 #1
0
        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);
        }
コード例 #2
0
        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
        }