VertexAnimation/Runtime/Scripts/VA_AnimationLibrary.cs
max 52dd9d4b3c AnimationLibrary start, AnimatorSystem parallel
Base setup animation library.
AnimatorSystem now runs in parallel.
TextureImporter preset.
2020-12-09 18:36:32 +01:00

38 lines
831 B
C#

using Unity.Entities;
using Unity.Collections;
namespace TAO.VertexAnimation
{
[System.Serializable]
public struct VA_AnimationData
{
public FixedString32 name;
public int frames;
public int maxFrames;
// 1.0f / maxFrames.
public float frameTime;
// frameTime * frames.
public float duration;
}
public struct VA_AnimationLibrary
{
public BlobArray<VA_AnimationData> animations;
}
public static class VA_AnimationLibraryUtils
{
public static int GetAnimation(ref VA_AnimationLibrary animationsRef, FixedString32 animationName)
{
for (int i = 0; i < animationsRef.animations.Length; i++)
{
if (animationsRef.animations[i].name == animationName)
{
return i;
}
}
return -1;
}
}
}