void IPerformanceTracker.OnAwake() { PerformanceDisplay performanceDisplay = new PerformanceDisplay(Color.blue, Color.red); KDebug.DisplayManager.RegisterDisplayAsPrimaryTab <TutorialWindow>(); KDebug.DisplayManager.RegisterDisplayAsPrimaryTab(performanceDisplay); KDebug.DisplayManager.RegisterDisplayAsPrimaryTab <ExampleStatsDisplay>(); }
public override IEnumerator PerformFirstPass() { Canvas canvas = Service.Get <Canvas>(); DebugGui componentInChildren = canvas.GetComponentInChildren <DebugGui>(); if (componentInChildren != null) { PerformanceDisplay component = componentInChildren.GetComponent <PerformanceDisplay>(); component.enabled = PerformanceDisplay; Service.Set(component); PrototypeDisplay component2 = componentInChildren.GetComponent <PrototypeDisplay>(); ContentVersionDisplay component3 = componentInChildren.GetComponent <ContentVersionDisplay>(); component3.enabled = ContentVersionDisplay; component2.enabled = PrototypeDisplay; Service.Set(componentInChildren); } yield break; }
public static void Update(GameTime gameTime) { if (performanceDisplay != PerformanceDisplay.None) { elapsedTime += gameTime.ElapsedGameTime; if (elapsedTime > TimeSpan.FromSeconds(1)) { elapsedTime -= TimeSpan.FromSeconds(1); frameRate = frameCounter; frameCounter = 0; } } #if WINDOWS if (KeyboardManager.KeyJustPressed(Keys.F1)) #endif #if XBOX if (PlayerProfile.getController(0) != null && PlayerProfile.getController(0).StartButton() && !PlayerProfile.getController(0).StartButton()) #endif performanceDisplay = performanceDisplay == PerformanceDisplay.Extended ? PerformanceDisplay.None : performanceDisplay + 1; }
void InitProfilersDisplay() { _performanceDisplay = FindObjectOfType <PerformanceDisplay>(); _performanceDisplay.IsProfilingActive = true; }