mirror of
https://github.com/maxartz15/VertexAnimation.git
synced 2024-11-12 23:45:31 +01:00
max
e4ca15301b
AnimationLibraryBook editor setup. AnimationLibrary texture2DArray generation and material setup.
38 lines
839 B
C#
38 lines
839 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_AnimationLibraryData
|
|
{
|
|
public BlobArray<VA_AnimationData> animations;
|
|
}
|
|
|
|
public static class VA_AnimationLibraryUtils
|
|
{
|
|
public static int GetAnimation(ref VA_AnimationLibraryData animationsRef, FixedString32 animationName)
|
|
{
|
|
for (int i = 0; i < animationsRef.animations.Length; i++)
|
|
{
|
|
if (animationsRef.animations[i].name == animationName)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
}
|
|
} |