예제 #1
0
        Wc.Vector3KeyFrameAnimation GetVector3KeyFrameAnimation(Wd.Vector3KeyFrameAnimation obj)
        {
            if (GetExisting(obj, out Wc.Vector3KeyFrameAnimation result))
            {
                return(result);
            }

            result = CacheAndInitializeKeyframeAnimation(obj, _c.CreateVector3KeyFrameAnimation());
            foreach (var kf in obj.KeyFrames)
            {
                switch (kf.Type)
                {
                case Wd.KeyFrameAnimation <Vector3> .KeyFrameType.Expression:
                    var expressionKeyFrame = (Wd.KeyFrameAnimation <Vector3> .ExpressionKeyFrame)kf;
                    result.InsertExpressionKeyFrame(kf.Progress, expressionKeyFrame.Expression, GetCompositionEasingFunction(kf.Easing));
                    break;

                case Wd.KeyFrameAnimation <Vector3> .KeyFrameType.Value:
                    var valueKeyFrame = (Wd.KeyFrameAnimation <Vector3> .ValueKeyFrame)kf;
                    result.InsertKeyFrame(kf.Progress, valueKeyFrame.Value, GetCompositionEasingFunction(kf.Easing));
                    break;

                default:
                    throw new InvalidCastException();
                }
            }

            StartAnimations(obj, result);
            return(result);
        }
예제 #2
0
 Vector3KeyFrameAnimation(Vector3KeyFrameAnimation other)
     : base(other)
 {
 }