Пример #1
0
 public override void Update(float time)
 {
     if (one != null)
     {
         one.Update(time);
     }
     if (two != null)
     {
         two.Update(time);
     }
 }
Пример #2
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 (Math.Abs(dt - 1.0f) < float.Epsilon && total < times)
                {
                    innerAction.Update(1.0f);

                    total++;
                }

                if (!actionInstant)
                {
                    if (total == times)
                    {
                        innerAction.Stop();
                    }
                    else
                    {
                        innerAction.Update(dt - (nextDt - innerAction.Duration / duration));
                    }
                }
            }
            else
            {
                var progress = (dt * times) % 1.0f;
                innerAction.Update(progress);
            }
        }