public float CalFPS() { ++FPS_frames; float timeNow = Time.realtimeSinceStartup; if (timeNow > FPS_lastInterval + FPS_updateInterval) { FPS_fps = (float)(FPS_frames / (timeNow - FPS_lastInterval)); FPS_frames = 0; FPS_lastInterval = timeNow; } return FPS_fps; }