blob: 4ee79cf94c5e6e7d8a39c2fd8ad7be7e6e5d1d4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
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<AnimationEventBase> animationEvents;
public List<ColliderData> hurtBoxes;
public List<ColliderData> hitBoxes;
public List<ColliderData> throwBoxes;
public List<ColliderData> blockBoxes;
public List<ColliderData> 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;
}
}
|