VertexAnimation/Runtime/Scripts/VA_Animation.cs
max c465ec6585 Simplify editor
Animations can now be used by scriptable object reference.
Bake saves book and animations.
Checks to update instead of create+overwrite assets to keep references/configuration.
2021-01-19 13:59:31 +01:00

36 lines
756 B
C#

using Unity.Collections;
using UnityEngine;
namespace TAO.VertexAnimation
{
public class VA_Animation : ScriptableObject
{
public VA_Animation(int a_maxFrames, int a_frames, int a_fps, int a_positionMapIndex, int a_colorMapIndex = -1)
{
Data = new VA_AnimationData(this.name, a_frames, a_maxFrames, a_fps, a_positionMapIndex, a_colorMapIndex);
}
public VA_Animation(VA_AnimationData a_data)
{
this.name = a_data.name.ToString();
Data = a_data;
}
public VA_AnimationData Data
{
get; private set;
}
// data.name will be overwritten by this.name.
public void SetData(VA_AnimationData a_data)
{
a_data.name = this.name;
Data = a_data;
}
public FixedString32 GetName()
{
return Data.name;
}
}
}