Ejemplo n.º 1
0
        public static NativeArray <Matrix4x4> GetBindPoses(this Sprite sprite)
        {
            SpriteChannelInfo       bindPoseInfo = SpriteDataAccessExtensions.GetBindPoseInfo(sprite);
            NativeArray <Matrix4x4> result       = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <Matrix4x4>(bindPoseInfo.buffer, bindPoseInfo.count, Allocator.Invalid);

            NativeArrayUnsafeUtility.SetAtomicSafetyHandle <Matrix4x4>(ref result, sprite.GetSafetyHandle());
            return(result);
        }
Ejemplo n.º 2
0
        public static NativeArray <BoneWeight> GetBoneWeights(this Sprite sprite)
        {
            SpriteChannelInfo        boneWeightsInfo = SpriteDataAccessExtensions.GetBoneWeightsInfo(sprite);
            NativeArray <BoneWeight> result          = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <BoneWeight>(boneWeightsInfo.buffer, boneWeightsInfo.count, Allocator.Invalid);

            NativeArrayUnsafeUtility.SetAtomicSafetyHandle <BoneWeight>(ref result, sprite.GetSafetyHandle());
            return(result);
        }
Ejemplo n.º 3
0
        public static NativeArray <Vector3> GetDeformableVertices(this SpriteRenderer spriteRenderer)
        {
            SpriteChannelInfo     deformableChannelInfo = spriteRenderer.GetDeformableChannelInfo(VertexAttribute.Position);
            NativeArray <Vector3> result = NativeArrayUnsafeUtility.ConvertExistingDataToNativeArray <Vector3>(deformableChannelInfo.buffer, deformableChannelInfo.count, Allocator.Invalid);

            NativeArrayUnsafeUtility.SetAtomicSafetyHandle <Vector3>(ref result, spriteRenderer.GetSafetyHandle());
            return(result);
        }
Ejemplo n.º 4
0
        public static NativeSlice <T> GetVertexAttribute <T>(this Sprite sprite, VertexAttribute channel) where T : struct
        {
            SpriteDataAccessExtensions.CheckAttributeTypeMatchesAndThrow <T>(channel);
            SpriteChannelInfo channelInfo = SpriteDataAccessExtensions.GetChannelInfo(sprite, channel);
            NativeSlice <T>   result      = NativeSliceUnsafeUtility.ConvertExistingDataToNativeSlice <T>(channelInfo.buffer, channelInfo.offset, channelInfo.count, channelInfo.stride);

            NativeSliceUnsafeUtility.SetAtomicSafetyHandle <T>(ref result, sprite.GetSafetyHandle());
            return(result);
        }
Ejemplo n.º 5
0
 private static extern void GetBoneWeightsInfo_Injected(Sprite sprite, out SpriteChannelInfo ret);
Ejemplo n.º 6
0
 private static extern void GetChannelInfo_Injected(Sprite sprite, VertexAttribute channel, out SpriteChannelInfo ret);
Ejemplo n.º 7
0
 private static extern void GetIndicesInfo_Injected(Sprite sprite, out SpriteChannelInfo ret);
Ejemplo n.º 8
0
 private static extern void GetBindPoseInfo_Injected(Sprite sprite, out SpriteChannelInfo ret);
Ejemplo n.º 9
0
 private static extern void GetDeformableChannelInfo_Injected(SpriteRenderer sprite, VertexAttribute channel, out SpriteChannelInfo ret);