コード例 #1
0
        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;
            }
        }
コード例 #2
0
 void FixedUpdate()
 {
     FytEarlyUpdateAll();
     FytUpdateAll();
     FytLateUpdateAll();
     input.Process();
     updateCounter++;
 }