示例#1
0
        public override void Update(float dt)
        {
            if (dt >= NextDt)
            {
                while (dt > NextDt && Total < Times)
                {
                    InnerAction.Update(1.0f);
                    ++Total;
                    InnerAction.Stop();
                    InnerAction.StartWithTarget(Target);
                    NextDt = InnerAction.Duration / Duration * (Total + 1);
                }

                if (dt >= 1.0f && Total < Times)
                {
                    ++Total;
                }

                if (Total == Times)
                {
                    InnerAction.Update(1.0f);
                    InnerAction.Stop();
                }
                else
                {
                    InnerAction.Update(dt - (NextDt - InnerAction.Duration / Duration));
                }
            }
            else
            {
                InnerAction.Update((dt * Times) % 1.0f);
            }
        }