internal static XRHumanBodySubsystemDescriptor Create(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
        {
            if (String.IsNullOrEmpty(humanBodySubsystemCinfo.id))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because id is invalid",
                                            "humanBodySubsystemCinfo");
            }

#if UNITY_2020_2_OR_NEWER
            if (humanBodySubsystemCinfo.providerType == null ||
                !humanBodySubsystemCinfo.providerType.IsSubclassOf(typeof(XRHumanBodySubsystem.Provider)))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because providerType is invalid",
                                            "humanBodySubsystemCinfo");
            }

            if (humanBodySubsystemCinfo.subsystemTypeOverride != null &&
                !humanBodySubsystemCinfo.subsystemTypeOverride.IsSubclassOf(typeof(XRHumanBodySubsystem)))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because subsystemTypeOverride is invalid",
                                            "humanBodySubsystemCinfo");
            }
#else
            if ((humanBodySubsystemCinfo.implementationType == null) ||
                !humanBodySubsystemCinfo.implementationType.IsSubclassOf(typeof(XRHumanBodySubsystem)))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because implementationType is invalid",
                                            "humanBodySubsystemCinfo");
            }
#endif

            return(new XRHumanBodySubsystemDescriptor(humanBodySubsystemCinfo));
        }
 XRHumanBodySubsystemDescriptor(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
 {
     id = humanBodySubsystemCinfo.id;
     subsystemImplementationType        = humanBodySubsystemCinfo.implementationType;
     supportsHumanBody2D                = humanBodySubsystemCinfo.supportsHumanBody2D;
     supportsHumanBody3D                = humanBodySubsystemCinfo.supportsHumanBody3D;
     supportsHumanBody3DScaleEstimation = humanBodySubsystemCinfo.supportsHumanBody3DScaleEstimation;
 }
Пример #3
0
 XRHumanBodySubsystemDescriptor(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
 {
     id = humanBodySubsystemCinfo.id;
     subsystemImplementationType = humanBodySubsystemCinfo.implementationType;
     supportsHumanBody2D         = humanBodySubsystemCinfo.supportsHumanBody2D;
     supportsHumanBody3D         = humanBodySubsystemCinfo.supportsHumanBody3D;
     supportsHumanStencilImage   = humanBodySubsystemCinfo.supportsHumanStencilImage;
     supportsHumanDepthImage     = humanBodySubsystemCinfo.supportsHumanDepthImage;
 }
 XRHumanBodySubsystemDescriptor(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
 {
     id                    = humanBodySubsystemCinfo.id;
     providerType          = humanBodySubsystemCinfo.providerType;
     subsystemTypeOverride = humanBodySubsystemCinfo.subsystemTypeOverride;
     supportsHumanBody2D   = humanBodySubsystemCinfo.supportsHumanBody2D;
     supportsHumanBody3D   = humanBodySubsystemCinfo.supportsHumanBody3D;
     supportsHumanBody3DScaleEstimation = humanBodySubsystemCinfo.supportsHumanBody3DScaleEstimation;
 }
        XRHumanBodySubsystemDescriptor(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
        {
            id = humanBodySubsystemCinfo.id;
#if UNITY_2020_2_OR_NEWER
            providerType          = humanBodySubsystemCinfo.providerType;
            subsystemTypeOverride = humanBodySubsystemCinfo.subsystemTypeOverride;
#else
            subsystemImplementationType = humanBodySubsystemCinfo.implementationType;
#endif
            supportsHumanBody2D = humanBodySubsystemCinfo.supportsHumanBody2D;
            supportsHumanBody3D = humanBodySubsystemCinfo.supportsHumanBody3D;
            supportsHumanBody3DScaleEstimation = humanBodySubsystemCinfo.supportsHumanBody3DScaleEstimation;
        }
        internal static XRHumanBodySubsystemDescriptor Create(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
        {
            if (String.IsNullOrEmpty(humanBodySubsystemCinfo.id))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because id is invalid",
                                            "humanBodySubsystemCinfo");
            }

            if ((humanBodySubsystemCinfo.implementationType == null) ||
                !humanBodySubsystemCinfo.implementationType.IsSubclassOf(typeof(XRHumanBodySubsystem)))
            {
                throw new ArgumentException("Cannot create human body subsystem descriptor because implementationType is invalid",
                                            "humanBodySubsystemCinfo");
            }

            return(new XRHumanBodySubsystemDescriptor(humanBodySubsystemCinfo));
        }
        /// <summary>
        /// Register the descriptor for the human body subsystem implementation.
        /// </summary>
        /// <param name="humanBodySubsystemCinfo">The human body subsystem implementation construction information.
        /// </param>
        /// <returns>
        /// <c>true</c> if the descriptor was registered. Otherwise, <c>false</c>.
        /// </returns>
        public static bool Register(XRHumanBodySubsystemCinfo humanBodySubsystemCinfo)
        {
            XRHumanBodySubsystemDescriptor humanBodySubsystemDescriptor = XRHumanBodySubsystemDescriptor.Create(humanBodySubsystemCinfo);

            return(SubsystemRegistration.CreateDescriptor(humanBodySubsystemDescriptor));
        }