GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pandr/unity-debug-overlay: A fast and garbage free debug overlay for Unity

BranchesTags
Open more actions menu

Latest commit

 

History

56 Commits
56 Commits

Folders and files

NameName
Last commit message
Last commit date
Assets
Assets
 
 
Packages
Packages
 
 
ProjectSettings
ProjectSettings
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

unity-debug-overlay

A fast, (almost) garbage-free debug overlay for Unity with three components: a debug overlay, a console, and a CVar system.

Garbage is minimized by avoiding string allocation — formatting uses C#-style format strings ("This: {0}") backed by a procedural renderer with no mesh allocation.

Debug overlay

Displays text, graphs, and primitives that update every frame:

// FPS in top left corner
DebugOverlay.Write(1, 0, "FPS:{0,6:###.##}", 1.0f / Time.deltaTime);

// Line graph of FPS below
fpsHistory[Time.frameCount % fpsHistory.Length] = 1.0f / Time.deltaTime;
DebugOverlay.DrawGraph(1, 1, 9, 1.5f, fpsHistory, Time.frameCount % fpsHistory.Length, Color.green);

Debug overlay

Additional drawing calls: DrawHist, DrawRect, DrawLine, DrawQuad, DrawTexturedQuad, SetColor, SetOrigin. Text supports inline color markup via ^RGB (e.g. ^F00 for red).

Console

Toggle with F12. Supports command history (up/down), tab completion, and mouse scroll.

Game.console.AddCommand("quit", CmdQuit, "Quit game");

void CmdQuit(string[] args)
{
    Game.console.Write("Goodbye\n");
    Application.Quit();
}

Console

Built-in commands: help, dump (scene hierarchy), cvars, watch.

CVars

Typed config variables readable and settable from the console at runtime:

static CVarFloat showFps = new CVarFloat("showfps", 0, "Show FPS counter");

// In update:
if (showFps.value > 0)
    DebugOverlay.Write(1, 0, "FPS:{0,6:###.##}", 1.0f / Time.deltaTime);

In the console: type showfps to read, showfps 1 to set. Use watch showfps to display it on the overlay continuously. Types supported: CVarFloat, CVarInt, CVarString.

About

A fast and garbage free debug overlay for Unity

Resources

Readme
CC0-1.0 license
Activity

Stars

142 stars

Watchers

7 watching

Forks

14 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.