[Test] public void ConvertOperation() { Assert.AreEqual((float)5, GenericOperator.Convert <int, float>(5)); Assert.AreEqual((int)5.5f, GenericOperator.Convert <float, int>(5.5f)); Assert.AreEqual((decimal)5.5f, GenericOperator.Convert <float, decimal>(5.5f)); Assert.AreEqual((int)ColorRgba.Red, GenericOperator.Convert <ColorRgba, int>(ColorRgba.Red)); }
public static TResult Convert <TFrom, TResult>(TFrom value) { return(GenericOperator <TFrom, TResult> .Convert(value)); }
T IAnimation.GetCurrentValue <T>() { return(GenericOperator.Convert <TValue, T>(this.CurrentValue)); }
void IAnimationKeyFrame.SetValue <U>(U value) { this.Value = GenericOperator.Convert <U, T>(value); }
U IAnimationKeyFrame.GetValue <U>() { return(GenericOperator.Convert <T, U>(this.Value)); }
void IAnimationTrack.SetValue <U>(float time, U value) { this.SetValue(time, GenericOperator.Convert <U, T>(value)); }
U IAnimationTrack.GetValue <U>(float time) { return(GenericOperator.Convert <T, U>(this.GetValue(time))); }