Spine.SkeletonData.FindAnimation C# (CSharp) Method

FindAnimation() public method

public FindAnimation ( String animationName ) : Animation
animationName String
return Animation
		public Animation FindAnimation (String animationName) {
			if (animationName == null) throw new ArgumentNullException("animationName", "animationName cannot be null.");
			ExposedList<Animation> animations = this.animations;
			for (int i = 0, n = animations.Count; i < n; i++) {
				Animation animation = animations.Items[i];
				if (animation.name == animationName) return animation;
			}
			return null;
		}

Usage Example

Esempio n. 1
0
        public void SetMix(String fromName, String toName, float duration)
        {
            Animation from = skeletonData.FindAnimation(fromName);

            if (from == null)
            {
                throw new ArgumentException("Animation not found: " + fromName);
            }
            Animation to = skeletonData.FindAnimation(toName);

            if (to == null)
            {
                throw new ArgumentException("Animation not found: " + toName);
            }
            SetMix(from, to, duration);
        }
All Usage Examples Of Spine.SkeletonData::FindAnimation