using System.Collections; using System.Collections.Generic; using UnityEngine; // 某个动画的数据,包括帧事件、碰撞盒 [CreateAssetMenu(fileName = "Animation Data")] public class AnimationData : ScriptableObject { public string animationName; public string animationPath; public List animationEvents; public List hurtBoxes; public List hitBoxes; public List throwBoxes; public List blockBoxes; public List defendBoxes; public int GetBoxesCount() { int hurt = hurtBoxes != null ? hurtBoxes.Count : 0; int hit = hitBoxes != null ? hitBoxes.Count : 0; int thro = throwBoxes != null ? throwBoxes.Count : 0; int block = blockBoxes != null ? blockBoxes.Count : 0; int defend = defendBoxes != null ? defendBoxes.Count : 0; return hurt + hit + thro + block + defend; } }