diff options
Diffstat (limited to 'Assets/Scripts/Unit/AnimationData.cs')
-rw-r--r-- | Assets/Scripts/Unit/AnimationData.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Assets/Scripts/Unit/AnimationData.cs b/Assets/Scripts/Unit/AnimationData.cs index 4ee79cf9..8717cf87 100644 --- a/Assets/Scripts/Unit/AnimationData.cs +++ b/Assets/Scripts/Unit/AnimationData.cs @@ -27,4 +27,48 @@ public class AnimationData : ScriptableObject return hurt + hit + thro + block + defend;
}
+ public void AddBox(List<ColliderData> boxList, ColliderData box)
+ {
+ if (boxList == null)
+ {
+ boxList = new List<ColliderData>();
+ return;
+ }
+ boxList.Add(box);
+ }
+
+ public void DeleteBox(ColliderData box)
+ {
+ if (hurtBoxes != null) hurtBoxes.Remove(box);
+ if (hitBoxes != null) hitBoxes.Remove(box);
+ if (throwBoxes != null) throwBoxes.Remove(box);
+ if (blockBoxes != null) blockBoxes.Remove(box);
+ if (defendBoxes != null) defendBoxes.Remove(box);
+ }
+
+ public ColliderData GetColliderByIndex(int index)
+ {
+ if (hurtBoxes != null && hurtBoxes.Count > index)
+ return hurtBoxes[index];
+ else
+ index -= hurtBoxes.Count;
+ if (hitBoxes != null && hitBoxes.Count > index)
+ return hitBoxes[index];
+ else
+ index -= hitBoxes.Count;
+ if (throwBoxes != null && throwBoxes.Count > index)
+ return throwBoxes[index];
+ else
+ index -= throwBoxes.Count;
+ if (blockBoxes != null && blockBoxes.Count > index)
+ return blockBoxes[index];
+ else
+ index -= blockBoxes.Count;
+ if (defendBoxes != null && defendBoxes.Count > index)
+ return defendBoxes[index];
+ else
+ index -= defendBoxes.Count;
+ return null;
+ }
+
}
|