예제 #1
0
        public override void Dispose()
        {
            if (IsDisposed)
            {
                return;
            }

            GC.SuppressFinalize(easingCurve);
            easingCurve = null;

            base.Dispose();
        }
예제 #2
0
        public SpartaPropertyAnimation(object instance, string propertyName, object from, object to, TimeSpan time, EasingCurve.EasingCurveType easingCurve, FinishedDelegate callback)
        {
            this.instance         = instance;
            this.propertyName     = propertyName;
            this.propertyInstance = instance.GetType().GetProperty(propertyName);
            this.property         = propertyInstance.GetValue(instance, null);

            this.From = from;
            this.To   = to;

            this.Duration    = time;
            this.easingCurve = new EasingCurve(easingCurve);

            Finished = callback;

            State = SpartaAnimationState.Stopped;
        }
예제 #3
0
        public override float Value(float t)
        {
            float o = (overshoot < 0) ? 1.70158f : overshoot;

            switch (type)
            {
            case EasingCurveFunction.Type.In:
                return(EasingCurve.EaseInBack(t, o));

            case EasingCurveFunction.Type.Out:
                return(EasingCurve.EaseOutBack(t, o));

            case EasingCurveFunction.Type.InOut:
                return(EasingCurve.EaseInOutBack(t, o));

            case EasingCurveFunction.Type.OutIn:
                return(EasingCurve.EaseOutInBack(t, o));

            default:
                return(t);
            }
        }