Exemplo n.º 1
0
        /// <summary>
        /// Called by the Director to advance scheduling forward by one frame.
        /// Generally speaking, never call this method unless you have a specific reason.
        /// </summary>
        /// <param name="dt">
        /// A <see cref="System.Single"/> indicating how much time has passed since the last frame
        /// </param>
        public void OnTick(float dt)
        {
            dt *= TimeScale;

            _elapsed += dt;

            RemovePendingTimers();
            AddPendingTimers();

            TickEventArgs te = new TickEventArgs(dt, _elapsed, _tickNumber++);

            foreach (Timer timer in _timers) {
                timer.OnTick(te);
            }
        }
Exemplo n.º 2
0
            internal void OnTick(TickEventArgs e)
            {
                if (_elapsed == -1) {
                    _elapsed = 0;
                }

                _elapsed += e.Delta;

                if (_elapsed >= Interval) {
                    _elapsed = 0;
                    if (Tick != null) {
                        Tick(this, e);
                    }
                }
            }
Exemplo n.º 3
0
 private void OnTick(object sender, TickEventArgs e)
 {
     Step(e.Delta);
 }