void Update()
        {
            if (executeInEditor)
            {
                if (_timeHelper == null)
                {
                    _timeHelper = TimeHelper.Create();
                }
                _timeHelper.Update();
                var dt         = _timeHelper.DeltaTime + _timeResidue;
                var fixedDelta = Time.fixedDeltaTime;
                var nSteps     = Mathf.FloorToInt(dt / fixedDelta);
                _timeResidue = dt - nSteps * fixedDelta;

                nSteps = Mathf.Min(100, nSteps);
                for (var i = 0; i < nSteps; i++)
                {
                    _physics.FixedUpdate(fixedDelta);
                }
            }
            else
            {
                _timeHelper = null;
            }
        }
Example #2
0
 void Update()
 {
     if (time.GetMillisecs() > 750)
     {
         SpawnBox();
         time = TimeHelper.Create();
     }
 }
Example #3
0
 void Start()
 {
     SpawnBox();
     time = TimeHelper.Create();
 }
Example #4
0
 void Start()
 {
     timer = TimeHelper.Create();
 }