/// <summary> /// Plays an animation, returning a <see cref="AnimationInstance"/> structure /// </summary> /// <param name="animationData"></param> /// <param name="fadeInTime">Time, in seconds, to fade the animation in</param> /// <param name="fadeOutTime">Time, in seconds, to fade the animation out</param> /// <returns></returns> protected AnimationInstance PlayAnimationData(AnimationData animationData, float fadeInTime, float fadeOutTime) { if (animationData == null) throw new ArgumentNullException(); if (fadeInTime < 0) throw new ArgumentException("fadeInTime"); if (fadeOutTime < 0) throw new ArgumentException("fadeOutTime"); if (!ContentLoaded) throw new InvalidOperationException("ModelInstance / AvatarInstance content has not been added"); if (disposed) throw new ObjectDisposedException("this"); AnimationStreamControl control = animationData.GetStream(); control.Initalise(false, fadeInTime, fadeOutTime); animations.Add(control); return new AnimationInstance(control); }