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
|
|
|
|
|
{
|
2021-01-18 13:42:45 +01:00
|
|
|
|
[CreateAssetMenu(fileName = "new AnimationLibrary", menuName = "TAO/VertexAnimation/AnimationLibrary", order = 400)]
|
2020-12-10 19:51:02 +01:00
|
|
|
|
public class VA_AnimationLibrary : ScriptableObject
|
2020-12-08 17:36:20 +01:00
|
|
|
|
{
|
2020-12-10 19:51:02 +01:00
|
|
|
|
[SerializeField]
|
2020-12-21 23:19:05 +01:00
|
|
|
|
private List<VA_AnimationBook> animationBooks = new List<VA_AnimationBook>();
|
2020-12-08 17:36:20 +01:00
|
|
|
|
|
2020-12-10 19:51:02 +01:00
|
|
|
|
[HideInInspector]
|
2021-01-19 01:18:25 +01:00
|
|
|
|
public List<VA_AnimationData> animationData = null;
|
2020-12-10 19:51:02 +01:00
|
|
|
|
|
2020-12-21 23:19:05 +01:00
|
|
|
|
public void Init()
|
2020-12-10 19:51:02 +01:00
|
|
|
|
{
|
2021-01-19 01:18:25 +01:00
|
|
|
|
animationData = new List<VA_AnimationData>();
|
2020-12-21 23:19:05 +01:00
|
|
|
|
|
2021-01-19 01:18:25 +01:00
|
|
|
|
foreach (VA_AnimationBook book in animationBooks)
|
2020-12-10 19:51:02 +01:00
|
|
|
|
{
|
2021-01-19 01:18:25 +01:00
|
|
|
|
book.SetMaterials();
|
|
|
|
|
|
|
|
|
|
foreach (VA_Animation animation in book.animations)
|
|
|
|
|
{
|
|
|
|
|
animationData.Add(animation.Data);
|
|
|
|
|
}
|
2020-12-10 19:51:02 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnValidate()
|
|
|
|
|
{
|
|
|
|
|
// TODO: Check for naming conflicts in AnimationBooks.
|
|
|
|
|
}
|
2020-12-08 17:36:20 +01:00
|
|
|
|
}
|
|
|
|
|
}
|