Example #1
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is LambdaAnimationSettings lambdaSettings))
            {
                throw new ArgumentException("LambdaAnimation: The given settings is not LambdaAnimationSettings");
            }

            _onAnimate = lambdaSettings.OnAnimate;
            base.ApplySettings(settings);
        }
Example #2
0
 protected virtual void ApplySettings(UIAnimationSettings settings)
 {
     MaxRepeats           = settings.MaxRepeats;
     DestroyUIObjectOnEnd = settings.DestroyUIObjectOnEnd;
     Duration             = settings.Duration;
     EasingType           = settings.EasingType;
     PlayType             = settings.PlayType;
     AnimateEvery         = settings.AnimateEvery;
     StartDelay           = settings.StartDelay;
     UpdateAnimation();
 }
Example #3
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UITurnAnimationSettings rotateSettings))
            {
                throw new ArgumentException("UITurnAnimation: The given settings is not UITurnAnimationSettings");
            }

            TurnValue    = rotateSettings.TurnValue;
            RotateAround = rotateSettings.RotateAround;

            base.ApplySettings(settings);
        }
Example #4
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UIShiftAnimationSettings translateSettings))
            {
                throw new ArgumentException("TranslateAnimation: The given settings is not TranslateAnimationSettings");
            }

            Shift      = translateSettings.Shift;
            RelativeTo = translateSettings.RelativeTo;

            base.ApplySettings(settings);
        }
Example #5
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UIScaleAnimationSettings scaleSettings))
            {
                throw new ArgumentException("UIScaleAnimation: The given settings is not UIScaleAnimationSettings");
            }

            StartScale = scaleSettings.StartScale;
            EndScale   = scaleSettings.EndScale;
            Anchor     = scaleSettings.Anchor;

            base.ApplySettings(settings);
        }
Example #6
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UILinearAnimationSettings linearSettings))
            {
                throw new ArgumentException("UILinearAnimation: The given settings is not UILinearAnimationSettings");
            }

            StartPos   = linearSettings.StartPos;
            EndPos     = linearSettings.EndPos;
            RelativeTo = linearSettings.RelativeTo;
            Anchor     = linearSettings.Anchor;

            base.ApplySettings(settings);
        }
Example #7
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UIRotateAnimationSettings rotateSettings))
            {
                throw new ArgumentException("UILinearAnimation: The given settings is not UIRotateAnimationSettings");
            }

            FromAngle    = rotateSettings.FromAngle;
            ToAngle      = rotateSettings.ToAngle;
            RelativeTo   = rotateSettings.RelativeTo;
            RotateAround = rotateSettings.RotateAround;

            base.ApplySettings(settings);
        }
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            if (!(settings is UIBezierQuadraticAnimationSettings bezierSettings))
            {
                throw new ArgumentException("UIBezierQuadraticAnimation: The given settings is not UIBezierQuadraticAnimationSettings");
            }

            RelativeTo  = bezierSettings.RelativeTo;
            FirstPoint  = bezierSettings.FirstPoint;
            SecondPoint = bezierSettings.SecondPoint;
            ThirdPoint  = bezierSettings.ThirdPoint;
            Anchor      = bezierSettings.Anchor;

            base.ApplySettings(settings);
        }
Example #9
0
        internal static T Create <T>(UIObject parent, UIAnimationSettings settings)
            where T : UIAnimation, new()
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            var animation = new T {
                UIObject = parent
            };

            animation.ApplySettings(settings);
            return(animation);
        }
Example #10
0
        protected override void ApplySettings(UIAnimationSettings settings)
        {
            _animatedObj = UIObject as IUIColored;
            if (_animatedObj == null)
            {
                throw new Exception("The animated object is not IColored");
            }

            if (!(settings is UIColorAnimationSettings colorSettings))
            {
                throw new ArgumentException("UIColorAnimation: The given settings is not UIColorAnimationSettings");
            }

            if (colorSettings.FromColor.ColorType != colorSettings.ToColor.ColorType)
            {
                throw new Exception("UIColorAnimationSettings.FromColor.Type != UIColorAnimationSettings.ToColor.Type");
            }

            FromColor = colorSettings.FromColor;
            ToColor   = colorSettings.ToColor;

            base.ApplySettings(settings);
        }