Exemplo n.º 1
0
        private static AtomicSafetyHandle GetSafetyHandle(this Sprite sprite)
        {
            AtomicSafetyHandle result;

            SpriteDataAccessExtensions.GetSafetyHandle_Injected(sprite, out result);
            return(result);
        }
Exemplo n.º 2
0
        private static SpriteChannelInfo GetBoneWeightsInfo(Sprite sprite)
        {
            SpriteChannelInfo result;

            SpriteDataAccessExtensions.GetBoneWeightsInfo_Injected(sprite, out result);
            return(result);
        }
Exemplo n.º 3
0
        private static SpriteChannelInfo GetChannelInfo(Sprite sprite, VertexAttribute channel)
        {
            SpriteChannelInfo result;

            SpriteDataAccessExtensions.GetChannelInfo_Injected(sprite, channel, out result);
            return(result);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
 public static void SetIndices(this Sprite sprite, NativeArray <ushort> src)
 {
     SpriteDataAccessExtensions.SetIndicesData(sprite, src.GetUnsafeReadOnlyPtr <ushort>(), src.Length);
 }
Exemplo n.º 8
0
 public static void SetBindPoses(this Sprite sprite, NativeArray <Matrix4x4> src)
 {
     SpriteDataAccessExtensions.SetBindPoseData(sprite, src.GetUnsafeReadOnlyPtr <Matrix4x4>(), src.Length);
 }
Exemplo n.º 9
0
 public static void SetVertexAttribute <T>(this Sprite sprite, VertexAttribute channel, NativeArray <T> src) where T : struct
 {
     SpriteDataAccessExtensions.CheckAttributeTypeMatchesAndThrow <T>(channel);
     SpriteDataAccessExtensions.SetChannelData(sprite, channel, src.GetUnsafeReadOnlyPtr <T>());
 }
Exemplo n.º 10
0
 public static void SetBones(this Sprite sprite, SpriteBone[] src)
 {
     SpriteDataAccessExtensions.SetBoneData(sprite, src);
 }
Exemplo n.º 11
0
 public static SpriteBone[] GetBones(this Sprite sprite)
 {
     return(SpriteDataAccessExtensions.GetBoneInfo(sprite));
 }
Exemplo n.º 12
0
 public static void SetBoneWeights(this Sprite sprite, NativeArray <BoneWeight> src)
 {
     SpriteDataAccessExtensions.SetBoneWeightsData(sprite, src.GetUnsafeReadOnlyPtr <BoneWeight>(), src.Length);
 }