protected virtual void OnGUI() #endif { if (ShowFps) { if (RenderWatcher == null) { RenderWatcher = new FpsWatcher(0.95f); } RenderWatcher.OnUIUpdate(); } UpdateEvent?.Invoke(); float time = Time.time; if (time > time_update_per1s) { time_update_per1s = time + 1.0f; UpdatePer1sEvent?.Invoke(); } if (time > time_update_per300ms) { time_update_per300ms = time + 0.3f; UpdatePer300msEvent?.Invoke(); } }
protected virtual void OnGUI() #endif { if (RenderWatcher != null) { RenderWatcher.OnUIUpdate(ShowFps); } }
protected virtual void OnGUI() #endif { if (ShowFps) { if (RenderWatcher == null) { RenderWatcher = new FpsWatcher(0.95f); } RenderWatcher.OnUIUpdate(); } }
private void OnGUI() { if (ShowFps) { if (RenderWatcher == null) { RenderWatcher = new CFpsWatcher(0.95f); } GUILayout.BeginVertical(GUILayout.Width(300)); GUILayout.Label(string.Format("Memory: {0:F3}KB", UnityEngine.Profiler.GetMonoUsedSize() / 1024f)); GUILayout.Label(RenderWatcher.Watch("FPS: {0:N0}", 1f / Time.deltaTime)); GUILayout.EndVertical(); } }