コード例 #1
0
            /// <summary>
            /// Gets the texture descriptors associated with th current camera
            /// frame.
            /// </summary>
            /// <returns>The texture descriptors.</returns>
            /// <param name="defaultDescriptor">Default descriptor.</param>
            /// <param name="allocator">Allocator.</param>
            public unsafe override NativeArray <XRTextureDescriptor> GetTextureDescriptors(
                XRTextureDescriptor defaultDescriptor,
                Allocator allocator)
            {
                int length, elementSize;
                var textureDescriptors = NativeApi.UnityARKit_Camera_AcquireTextureDescriptors(
                    out length, out elementSize);

                try
                {
                    return(NativeCopyUtility.PtrToNativeArrayWithDefault(
                               defaultDescriptor,
                               textureDescriptors, elementSize, length, allocator));
                }
                finally
                {
                    NativeApi.UnityARKit_Camera_ReleaseTextureDescriptors(textureDescriptors);
                }
            }