{"id":13662286,"url":"https://github.com/elringus/unity-console","last_synced_at":"2025-04-10T21:20:57.501Z","repository":{"id":152276080,"uuid":"143755141","full_name":"elringus/unity-console","owner":"elringus","description":"Development console for Unity game engine","archived":false,"fork":false,"pushed_at":"2024-01-19T17:19:54.000Z","size":437,"stargazers_count":108,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T18:49:38.784Z","etag":null,"topics":["debugging-tool","unity3d","unity3d-plugin"],"latest_commit_sha":null,"homepage":null,"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/elringus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"elringus"}},"created_at":"2018-08-06T16:30:14.000Z","updated_at":"2025-03-21T03:35:54.000Z","dependencies_parsed_at":"2024-08-02T05:13:17.046Z","dependency_job_id":"0bfa2a65-0ac2-4ca5-92a5-30ac06536fbd","html_url":"https://github.com/elringus/unity-console","commit_stats":null,"previous_names":["elringus/unity-console","elringus/unityconsole"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elringus%2Funity-console","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elringus%2Funity-console/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elringus%2Funity-console/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elringus%2Funity-console/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elringus","download_url":"https://codeload.github.com/elringus/unity-console/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298916,"owners_count":21080433,"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-tool","unity3d","unity3d-plugin"],"created_at":"2024-08-02T05:01:54.447Z","updated_at":"2025-04-10T21:20:57.482Z","avatar_url":"https://github.com/elringus.png","language":"C#","funding_links":["https://github.com/sponsors/elringus"],"categories":["C\\#"],"sub_categories":[],"readme":"## Description\n\nAllows executing static C# methods via an on-demand console IMGUI.\n\n![](https://github.com/elringus/unity-console/blob/main/preview.gif)\n\n## Installation\n\nUse [UPM](https://docs.unity3d.com/Manual/upm-ui-giturl.html) to install the package via the following Git URL: `https://github.com/elringus/unity-console.git#package`.\n\n![](https://i.gyazo.com/b54e9daa9a483d9bf7f74f0e94b2d38a.gif)\n\nAlternatively, manually copy `Assets/UnityConsole` folder from the repository to the Unity project.\n\nMinimum supported Unity version: 2019.4.\n\n## How to Use\n\nRegister commands by adding  `ConsoleCommand` attribute to static C# methods. The attribute has an optional string argument, allowing to assign an alias (shortcut).\n\n```csharp\n[UnityConsole.ConsoleCommand(\"hello\")]\npublic static void PrintHelloWorld () =\u003e Debug.Log(\"Hello World!\");\n\n[UnityConsole.ConsoleCommand]\npublic static void Add (int arg1, int arg2) =\u003e Debug.Log(arg1 + arg2);\n```\n\nEnable the console at runtime with:\n\n```csharp\nUnityConsole.ConsoleGUI.Initialize()\n```\n\nToggle console GUI with `~` key. The key can be overridden via `ConsoleGUI.ToggleKey` public static property. It's also possible to toggle console with a multi-(3 or more) touch on touch screen devices.\n\nIn the console, type either method name or alias of a registered command and press `Enter` key to invoke the method. Method arguments are separated with a single whitespace. To specify string arguments with whitespace, wrap them in double or single quotes.\n\nUse `Up` and `Down` to navigate over previously executed commands.\n\nTo disable the console at runtime:\n\n```csharp\nUnityConsole.ConsoleGUI.Destroy()\n```\n\n## Preprocessors\n\nIt's possible to inject delegates to modify the console input before it's send for execution, eg:\n\n```csharp\nusing UnityConsole;\nusing UnityEngine;\n\npublic class TestPreprocessor : MonoBehaviour\n{\n    private void OnEnable ()\n    {\n        InputPreprocessor.AddPreprocessor(PreprocessInput);\n    }\n\n    private void OnDisable ()\n    {\n        InputPreprocessor.RemovePreprocessor(PreprocessInput);\n    }\n\n    private string PreprocessInput (string input)\n    {\n        if (input != null \u0026\u0026 input.StartsWith(\"@\"))\n        {\n            Debug.Log(input);\n            return null;\n        }\n        return input;\n    }\n}\n```\n\n— will intercept commands starting with `@` and instead log the input. Notice, that when a preprocessor delegate returns `null` it will stop the default console behaviour.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felringus%2Funity-console","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felringus%2Funity-console","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felringus%2Funity-console/lists"}