void Update() { float currentDeltaTime = Time.deltaTime; accumulator += currentDeltaTime; while (accumulator >= FRAME_TIME) { FytEarlyUpdateAll(); FytUpdateAll(); FytLateUpdateAll(); input.Process(); updateCounter++; accumulator -= FRAME_TIME; } input.Poll(); frameCounter++; debugTimer += currentDeltaTime; if (debugTimer >= SECOND) { //Debug.Log("UPS: " + updateCounter); //Debug.Log("FPS: " + frameCounter); updateCounter = 0; frameCounter = 0; debugTimer -= SECOND; } }
void Update() { input.Poll(); frameCounter++; debugTimer += Time.deltaTime; if (debugTimer >= SECOND) { //Debug.Log("UPS: " + updateCounter); //Debug.Log("FPS: " + frameCounter); updateCounter = 0; frameCounter = 0; debugTimer -= SECOND; } }