2020-12-10 19:51:02 +01:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2020-12-08 17:36:20 +01:00
|
|
|
|
|
|
|
|
|
namespace TAO.VertexAnimation
|
|
|
|
|
{
|
2020-12-10 19:51:02 +01:00
|
|
|
|
[CreateAssetMenu(fileName = "new AnimationLibrary", menuName = "AnimationLibrary", order = 0)]
|
|
|
|
|
public class VA_AnimationLibrary : ScriptableObject
|
2020-12-08 17:36:20 +01:00
|
|
|
|
{
|
2020-12-10 19:51:02 +01:00
|
|
|
|
[SerializeField]
|
|
|
|
|
private VA_AnimationBook[] animationBooks;
|
2020-12-08 17:36:20 +01:00
|
|
|
|
|
2020-12-10 19:51:02 +01:00
|
|
|
|
[HideInInspector]
|
|
|
|
|
public List<VA_AnimationData> animations = null;
|
|
|
|
|
|
|
|
|
|
public void Create()
|
|
|
|
|
{
|
|
|
|
|
foreach (VA_AnimationBook book in animationBooks)
|
|
|
|
|
{
|
|
|
|
|
book.Create();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConvertAnimations();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnValidate()
|
|
|
|
|
{
|
|
|
|
|
// TODO: Check for naming conflicts in AnimationBooks.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void ConvertAnimations()
|
2020-12-08 17:36:20 +01:00
|
|
|
|
{
|
2020-12-10 19:51:02 +01:00
|
|
|
|
animations = new List<VA_AnimationData>();
|
2020-12-08 17:36:20 +01:00
|
|
|
|
|
2020-12-10 19:51:02 +01:00
|
|
|
|
if (animationBooks != null)
|
|
|
|
|
{
|
2020-12-14 20:27:44 +01:00
|
|
|
|
foreach (var ab in animationBooks)
|
2020-12-10 19:51:02 +01:00
|
|
|
|
{
|
2020-12-14 20:27:44 +01:00
|
|
|
|
animations.AddRange(ab.GetAnimationData());
|
2020-12-10 19:51:02 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-12-08 17:36:20 +01:00
|
|
|
|
}
|
|
|
|
|
}
|