public void Animate( string animationName, Bind pctl, IBaseModel model, string propertyName, object endValue, float start, float length) { if (model.GetPropertyByName(propertyName).GetType().Equals(typeof(int))) { KineticPath path = new KineticPath( (int)pctl.Get(), (int)endValue, length); PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl); anim.Start = GetCurrentGameTime() + start; anim.End = GetCurrentGameTime() + length + start; AddAnimation(animationName, anim); } else { throw new NotImplementedException("Only integers can be animated now!!!"); } }
public void AnimateColor( string animationName, Bind pctl, object endValue, float length) { ColorAnimationPath path = new ColorAnimationPath( (Color)pctl.Get(), (Color)endValue, length); PropertyAnimation anim = new PropertyAnimation(animationName, path.ComputeFrame, pctl); anim.Start = CoreAnimation.Instance.GetCurrentGameTime(); anim.End = CoreAnimation.Instance.GetCurrentGameTime() + length; CoreAnimation.Instance.AddAnimation(animationName, anim); }