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); } }
public override void StartWithTarget(CozyNode target) { Total = 0; NextDt = InnerAction.Duration / Duration; base.StartWithTarget(target); InnerAction.StartWithTarget(target); }