Exemplo n.º 1
0
        Wc.Vector2KeyFrameAnimation GetVector2KeyFrameAnimation(Wd.Vector2KeyFrameAnimation obj)
        {
            if (GetExisting(obj, out Wc.Vector2KeyFrameAnimation result))
            {
                return(result);
            }

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

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

                default:
                    throw new InvalidOperationException();
                }
            }

            StartAnimations(obj, result);
            return(result);
        }
Exemplo n.º 2
0
 Vector2KeyFrameAnimation(Vector2KeyFrameAnimation other)
     : base(other)
 {
 }