/// <summary> /// Initializes a new instance of the <see cref="AnimatedController"/> class. /// </summary> /// <param name="model">The model.</param> /// <param name="StartAnimationName">Start name of the animation.</param> /// <param name="changeOnlyWhenDifferentAnimation">if set to <c>true</c> [change the current animationonly only when different animation is set].</param> public AnimatedController(IAnimatedModel model, String StartAnimationName = null,bool changeOnlyWhenDifferentAnimation = true) { skinnedModel = model.GetAnimation() as SkinnedModel; animationController = new AnimationController(skinnedModel.SkeletonBones); this.StartAnimationName = StartAnimationName; this.actualAnimation = StartAnimationName; if(StartAnimationName != null) animationController.StartClip(skinnedModel.AnimationClips[StartAnimationName]); this.changeOnlyWhenDifferentAnimation = changeOnlyWhenDifferentAnimation; }
/// <summary> /// Initializes a new instance of the <see cref="AnimatedController"/> class. /// </summary> /// <param name="model">The model.</param> /// <param name="StartAnimationName">Start name of the animation.</param> /// <param name="changeOnlyWhenDifferentAnimation">if set to <c>true</c> [change the current animationonly only when different animation is set].</param> public AnimatedController(IAnimatedModel model, String StartAnimationName = null, bool changeOnlyWhenDifferentAnimation = true) { skinnedModel = model.GetAnimation() as SkinnedModel; animationController = new AnimationController(skinnedModel.SkeletonBones); this.StartAnimationName = StartAnimationName; this.actualAnimation = StartAnimationName; if (StartAnimationName != null) { animationController.StartClip(skinnedModel.AnimationClips[StartAnimationName]); } this.changeOnlyWhenDifferentAnimation = changeOnlyWhenDifferentAnimation; }