{"id":16209924,"url":"https://github.com/annulusgames/debugui","last_synced_at":"2025-04-09T09:05:16.737Z","repository":{"id":220650161,"uuid":"751772577","full_name":"annulusgames/DebugUI","owner":"annulusgames","description":"A framework for building debugging tools built on Unity UI Toolkit.","archived":false,"fork":false,"pushed_at":"2024-08-17T07:49:16.000Z","size":1203,"stargazers_count":258,"open_issues_count":5,"forks_count":23,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-09T09:05:11.528Z","etag":null,"topics":["debugging-tools","gui","uitoolkit","unity"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/annulusgames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-02T09:46:47.000Z","updated_at":"2025-04-03T14:55:52.000Z","dependencies_parsed_at":"2024-10-27T20:27:19.235Z","dependency_job_id":"92788ac5-1c14-43df-bd48-0113f4fc2d40","html_url":"https://github.com/annulusgames/DebugUI","commit_stats":null,"previous_names":["annulusgames/debugui","yn01dev/debugui","yn01-dev/debugui","nuskey8/debugui"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FDebugUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FDebugUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FDebugUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annulusgames%2FDebugUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annulusgames","download_url":"https://codeload.github.com/annulusgames/DebugUI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008630,"owners_count":21032556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debugging-tools","gui","uitoolkit","unity"],"created_at":"2024-10-10T10:34:10.184Z","updated_at":"2025-04-09T09:05:16.714Z","avatar_url":"https://github.com/annulusgames.png","language":"C#","readme":"# DebugUI\n A framework for building debugging tools built on Unity UI Toolkit.\n\n[![license](https://img.shields.io/badge/LICENSE-MIT-green.svg)](LICENSE)\n![unity-version](https://img.shields.io/badge/unity-2022.1+-000.svg)\n[![releases](https://img.shields.io/github/release/AnnulusGames/DebugUI.svg)](https://github.com/AnnulusGames/DebugUI/releases)\n\n[日本語版READMEはこちら](README_JA.md)\n\nDebugUI is a framework for building debugging tools on Unity UI Toolkit. You can easily and quickly create runtime debugging tools using its dedicated builder.\n\n```cs\npublic class DemoUIBuilder : DebugUIBuilderBase\n{\n    ...\n\n    protected override void Configure(IDebugUIBuilder builder)\n    {\n        builder.ConfigureWindowOptions(options =\u003e\n        {\n            options.Title = \"Demo\";\n            options.Draggable = true;\n        });\n\n        builder.AddFoldout(\"Physics\", builder =\u003e\n        {\n            builder.AddSlider(\"Time Scale\", 0f, 3f, () =\u003e Time.timeScale, x =\u003e Time.timeScale = x);\n            builder.AddSlider(\"Gravity Scale\", 0f, 3f, () =\u003e GravityScale, x =\u003e GravityScale = x);\n            builder.AddButton(\"Add Circle\", () =\u003e Instantiate(prefab));\n            builder.AddButton(\"Reload Scene\", () =\u003e SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex));\n        });\n\n        builder.AddFoldout(\"Post-processing\", builder =\u003e\n        {\n            builder.AddSlider(\"Hue Shift\", -180f, 180f, () =\u003e colorAdjustments.hueShift.value, x =\u003e colorAdjustments.hueShift.value = x);\n            builder.AddSlider(\"Bloom Intensity\", 0f, 10f, () =\u003e bloom.intensity.value, x =\u003e bloom.intensity.value = x);\n        });\n    }\n}\n```\n\n![img](docs/images/img1.png)\n\n## Setup\n\n### Requirements\n\n* Unity 2022.1 or later\n\n### Installation\n\n1. Open the Package Manager from Window \u003e Package Manager.\n2. Click the \"+\" button \u003e Add package from git URL.\n3. Enter the following URL:\n\n```\nhttps://github.com/AnnulusGames/DebugUI.git?path=src/DebugUI/Assets/DebugUI\n```\n\nAlternatively, open Packages/manifest.json and add the following to the dependencies block:\n\n```json\n{\n    \"dependencies\": {\n        \"com.annulusgames.debug-ui\": \"https://github.com/AnnulusGames/DebugUI.git?path=src/DebugUI/Assets/DebugUI\"\n    }\n}\n```\n\n## Creating a Debug Window\n\nTo create a debug window using DebugUI, follow these steps.\n\n### 1A. Create a component that inherits from DebugUIBuilderBase\n\nInherit from the `DebugUIBuilderBase` class, and by implementing the `Configure()` method, you can easily configure a debug window.\n\n```cs\nusing UnityEngine;\nusing DebugUI; \n\npublic class DebugUIBuilerExample : DebugUIBuilderBase\n{\n    [SerializeField] float field;\n\n    protected override void Configure(IDebugUIBuilder builder)\n    {\n        builder.AddLabel(\"Label\");\n        builder.AddButton(\"Button\", () =\u003e Debug.Log(\"Hello!\"));\n        builder.AddField(\"Field\", () =\u003e field, x =\u003e field = x);\n    }\n}\n```\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/img2.png\" width=\"500\"\u003e\n\nAttach this component to a suitable GameObject and specify the target UIDocument in the Inspector.\n\n`DebugUIBuilderBase` is a class that inherits from `MonoBehaviour`. It creates a debug window on the UIDocument set at Awake time.\n\n### 1B. Use the DebugUIBuilder class\n\nIf you want to avoid adding a new component, you can also create a debug window using the `DebugUIBuilder` class.\n\n```cs\nUIDocument uiDocument;\n\nvar builder = new DebugUIBuilder();\nbuilder.AddLabel(\"Label\");\nbuilder.AddButton(\"Button\", () =\u003e Debug.Log(\"Hello!\"));\nbuilder.AddField(\"Field\", () =\u003e field, x =\u003e field = x);\nbuilder.BuildWith(uiDocument);\n```\n\nTo build the configured debug window, call the `BuildWith()` method.\n\n### 2. Apply the Theme Style Sheet\n\nDebugUI provides a StyleSheet (uss) and Theme StyleSheet (tss) for a modern GUI style. (The files are located in the `Packages/com.annulusgames.debug-ui/Package Resources` folder.)\n\nYou can change the theme you want to use in the Panel Settings asset generated in the Assets folder when you introduce the UI Toolkit.\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/img3.png\" width=\"500\"\u003e\n\nIf you want to use an existing theme, add the DebugUI uss to the Style Sheets of the tss asset you want to use.\n\n## Available Elements\n\n### Label\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-label.png\" width=\"400\"\u003e\n\n```cs\nbuilder.AddLabel(\"Label\");\n```\n\n### Button\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-button.png\" width=\"400\"\u003e\n\n```cs\nbuilder.AddButton(\"Button\", () =\u003e Debug.Log(\"Hello!\"));\n```\n\n### Field\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-field.png\" width=\"400\"\u003e\n\n```cs\nfloat floatValue;\n\nbuilder.AddField(\"Field\", () =\u003e floatValue, x =\u003e floatValue = x);\nbuilder.AddField(\"Read-Only Field\", () =\u003e floatValue);\n```\n\n\u003e [!NOTE]\n\u003e `AddField()` currently supports `bool`, `int`, `float`, `string`, ,`Enum`, `Vector2`, `Vector3`, `Vector4`, `Vector2Int`, `Vector3Int`, `Rect`, `RectInt`, `Bounds`, and `BoundsInt`.\n\n\u003e [!TIP]\n\u003e Fields created with `AddField()` are bidirectionally bound to the target value. Changes made to either the field or the original value are automatically reflected in the other.\n\n### Slider\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-slider.png\" width=\"400\"\u003e\n\n```cs\nfloat floatValue;\nint intValue;\n\nbuilder.AddSlider(\"Slider\", 0f, 1f, () =\u003e floatValue, x =\u003e floatValue = x);\nbuilder.AddSlider(\"Slider Int\", 0, 100, () =\u003e intValue, x =\u003e intValue = x);\n```\n\n### Progress Bar\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-progress.png\" width=\"400\"\u003e\n\n```cs\nfloat floatValue;\n\nbuilder.AddProgressBar(\"Progress\", 0f, 1f, () =\u003e floatValue);\n```\n\n### Image\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-image.png\" width=\"400\"\u003e\n\n```cs\nTexture2D texture2D;\nSprite sprite;\nRenderTexture renderTexture;\nSpriteRenderer spriteRenderer;\n\nbuilder.AddImage(\"Texture2D\", texture2D);\nbuilder.AddImage(\"Sprite\", sprite);\nbuilder.AddImage(\"Render Texture\", renderTexture);\nbuilder.AddImage(\"Dynamic\", () =\u003e spriteRenderer.sprite);\n```\n\n### Foldout\n\n\u003cimg src=\"https://github.com/AnnulusGames/DebugUI/blob/main/docs/images/example-foldout.png\" width=\"400\"\u003e\n\n```cs\nfloat floatValue;\n\nbuilder.AddFoldout(\"Foldout\", builder =\u003e\n{\n    builder.AddField(\"Field\", () =\u003e floatValue, x =\u003e floatValue = x);\n    builder.AddButton(\"Button\", () =\u003e Debug.Log(\"Hello!\"));\n});\n```\n\n## Window Settings\n\nYou can configure window display options and other settings using `ConfigureWindowOptions()`.\n\n```cs\nbuilder.ConfigureWindowOptions(options =\u003e\n{\n    options.Title = \"Custom Title\";\n    options.Draggable = false;\n});\n```\n\n| Property  | Description                                             |\n| --------- | ------------------------------------------------------- |\n| Draggable | Whether the window is draggable (default value is true) |\n| Title     | Title of the window                                     |\n\n## License\n\n[MIT License](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Fdebugui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannulusgames%2Fdebugui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannulusgames%2Fdebugui/lists"}