123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- using System;
- using System.Collections.Generic;
- namespace Spine
- {
- public class SkeletonData
- {
- public string Name
- {
- get
- {
- return this.name;
- }
- set
- {
- this.name = value;
- }
- }
- public List<BoneData> Bones
- {
- get
- {
- return this.bones;
- }
- }
- public List<SlotData> Slots
- {
- get
- {
- return this.slots;
- }
- }
- public List<Skin> Skins
- {
- get
- {
- return this.skins;
- }
- set
- {
- this.skins = value;
- }
- }
- public Skin DefaultSkin
- {
- get
- {
- return this.defaultSkin;
- }
- set
- {
- this.defaultSkin = value;
- }
- }
- public List<EventData> Events
- {
- get
- {
- return this.events;
- }
- set
- {
- this.events = value;
- }
- }
- public List<Animation> Animations
- {
- get
- {
- return this.animations;
- }
- set
- {
- this.animations = value;
- }
- }
- public List<IkConstraintData> IkConstraints
- {
- get
- {
- return this.ikConstraints;
- }
- set
- {
- this.ikConstraints = value;
- }
- }
- public float Width
- {
- get
- {
- return this.width;
- }
- set
- {
- this.width = value;
- }
- }
- public float Height
- {
- get
- {
- return this.height;
- }
- set
- {
- this.height = value;
- }
- }
- public string Version
- {
- get
- {
- return this.version;
- }
- set
- {
- this.version = value;
- }
- }
- public string Hash
- {
- get
- {
- return this.hash;
- }
- set
- {
- this.hash = value;
- }
- }
- public BoneData FindBone(string boneName)
- {
- if (boneName == null)
- {
- throw new ArgumentNullException("boneName cannot be null.");
- }
- List<BoneData> list = this.bones;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- BoneData boneData = list[i];
- if (boneData.name == boneName)
- {
- return boneData;
- }
- i++;
- }
- return null;
- }
- public int FindBoneIndex(string boneName)
- {
- if (boneName == null)
- {
- throw new ArgumentNullException("boneName cannot be null.");
- }
- List<BoneData> list = this.bones;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- if (list[i].name == boneName)
- {
- return i;
- }
- i++;
- }
- return -1;
- }
- public SlotData FindSlot(string slotName)
- {
- if (slotName == null)
- {
- throw new ArgumentNullException("slotName cannot be null.");
- }
- List<SlotData> list = this.slots;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- SlotData slotData = list[i];
- if (slotData.name == slotName)
- {
- return slotData;
- }
- i++;
- }
- return null;
- }
- public int FindSlotIndex(string slotName)
- {
- if (slotName == null)
- {
- throw new ArgumentNullException("slotName cannot be null.");
- }
- List<SlotData> list = this.slots;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- if (list[i].name == slotName)
- {
- return i;
- }
- i++;
- }
- return -1;
- }
- public Skin FindSkin(string skinName)
- {
- if (skinName == null)
- {
- throw new ArgumentNullException("skinName cannot be null.");
- }
- foreach (Skin skin in this.skins)
- {
- if (skin.name == skinName)
- {
- return skin;
- }
- }
- return null;
- }
- public EventData FindEvent(string eventDataName)
- {
- if (eventDataName == null)
- {
- throw new ArgumentNullException("eventDataName cannot be null.");
- }
- foreach (EventData eventData in this.events)
- {
- if (eventData.name == eventDataName)
- {
- return eventData;
- }
- }
- return null;
- }
- public Animation FindAnimation(string animationName)
- {
- if (animationName == null)
- {
- throw new ArgumentNullException("animationName cannot be null.");
- }
- List<Animation> list = this.animations;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- Animation animation = list[i];
- if (animation.name == animationName)
- {
- return animation;
- }
- i++;
- }
- return null;
- }
- public IkConstraintData FindIkConstraint(string ikConstraintName)
- {
- if (ikConstraintName == null)
- {
- throw new ArgumentNullException("ikConstraintName cannot be null.");
- }
- List<IkConstraintData> list = this.ikConstraints;
- int i = 0;
- int count = list.Count;
- while (i < count)
- {
- IkConstraintData ikConstraintData = list[i];
- if (ikConstraintData.name == ikConstraintName)
- {
- return ikConstraintData;
- }
- i++;
- }
- return null;
- }
- public override string ToString()
- {
- return this.name ?? base.ToString();
- }
- internal string name;
- internal List<BoneData> bones = new List<BoneData>();
- internal List<SlotData> slots = new List<SlotData>();
- internal List<Skin> skins = new List<Skin>();
- internal Skin defaultSkin;
- internal List<EventData> events = new List<EventData>();
- internal List<Animation> animations = new List<Animation>();
- internal List<IkConstraintData> ikConstraints = new List<IkConstraintData>();
- internal float width;
- internal float height;
- internal string version;
- internal string hash;
- internal string imagesPath;
- }
- }
|