Esempio n. 1
0
        static void Main(string[] args)
        {
            bool continueRun = true;

            while (continueRun == true)
            {
                continueRun = LoopMethod.LogicLoop(continueRun);
            }
        }
Esempio n. 2
0
 protected AnimationEvent(AnimationEventData animationEventData)
 {
     actor          = animationEventData.actor;
     destination    = animationEventData.destination;
     maxTime        = animationEventData.maxTime;
     smoothing      = animationEventData.smoothing;
     loopMethod     = animationEventData.loopMethod;
     isRelative     = animationEventData.isRelative;
     body           = animationEventData.body;
     callback       = animationEventData.callback;
     resetAfterDone = animationEventData.resetAferDone;
 }
Esempio n. 3
0
        public static bool Loop(LoopMethod loopMethod, ref int x, ref int step, int max)
        {
            switch (loopMethod)
            {
            case LoopMethod.PlayOnce:
                if (x > max)
                {
                    x = max;
                    return(true);
                }

                break;

            case LoopMethod.Loop:
                if (x > max)
                {
                    x = 0;
                }
                break;

            case LoopMethod.PingPongOnce:
                if (x > max)
                {
                    step = -1;
                    x    = max;
                }

                if (x < 0)
                {
                    x = 0;
                    return(true);
                }

                break;

            case LoopMethod.PingPongLoop:
                if (x > max)
                {
                    step = -1;
                    x    = max;
                }

                if (x <= 0)
                {
                    step = 1;
                }
                break;
            }

            return(false);
        }
Esempio n. 4
0
        public static Rest <T> Loop <T>(Rest <T> rest, int count)
        {
            var loop = new LoopMethod <T>(rest, count);

            return(loop.LoopAsync);
        }