示例#1
0
        protected void Start(Control control, TransitionType transitionTypee, int duration, AnimationAction actionHandlerr, AnimationFinishedEvaluator evaluatorHandlerr)
        {
            targetControl    = control;
            transitionType   = transitionTypee;
            actionHandler    = actionHandlerr;
            evaluatorHandler = evaluatorHandlerr;

            counter    = 0;
            startTime  = 0;
            targetTime = duration;

            timer = DelayedCall.Start(DoAnimation, duration);
        }
示例#2
0
        private void DoAnimation()
        {
            if (evaluatorHandler == null || evaluatorHandler.Invoke())
            {
                OnAnimationCompleted();
            }
            else
            {
                actionHandler.Invoke();
                counter++;

                timer.Start();
            }
        }
示例#3
0
        public static DelayedCall StartAsync(Callback cb, int milliseconds)
        {
            DelayedCall dc = CreateAsync(cb, milliseconds);

            if (milliseconds > 0)
            {
                dc.Start();
            }
            else if (milliseconds == 0)
            {
                dc.FireNow();
            }

            return(dc);
        }