Reka Debug Console
A lightweight, extensible in-game debug console for Unity. Define commands as ScriptableObjects, subscribe to them from your scripts, and execute them at runtime through a console overlay. The package provides core Command and ConsoleSettings types, with sample UI and input handling included as a starting point for customization. Perfect for debugging, testing, and runtime command execution during development.
com.reka.debug.console 
Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/higlix-console.git README Markdown
Copy this to your project's README.md
## Installation
Add **Reka Debug Console** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/higlix-console.git
```
[](https://www.pkglnk.dev/pkg/higlix-console)Dependencies (3)
README
Reka Debug Console
A lightweight, extensible in-game debug console for Unity. Define commands as ScriptableObjects, subscribe to them from your own scripts, and execute them at runtime through a console overlay.
What the Package Provides
The package ships two core ScriptableObject types in Runtime/:
- Command (
Create > DebugConsole > Command) ā A ScriptableObject that represents a single console command. Each command has a name, description, and an extension (e.g.test.random.hello). Other scripts subscribe to itsOnCommandExecutedevent to run logic when the command is executed. - ConsoleSettings (
Create > Console > ConsoleSettings) ā A ScriptableObject that holds configuration: whether the console is visible on start, and the list of registered Command assets.
Everything else ā the console UI, input handling, and sample scripts ā is provided in the Samples folder as a starting point. You are free to build your own console implementation on top of the two core types.
Requirements
- Unity 2021.3 or later
- Input System (
com.unity.inputsystem) - TextMeshPro (
com.unity.textmeshpro) - Unity UI (
com.unity.ugui)
Installation
Git URL (recommended)
In your Unity project, open Window > Package Manager > + > Add package from git URL... and enter:
https://github.com/Higlix/Debug-Console-Unity6-Package.git
Local / From Disk
- Clone or download this repository.
- In Unity, open Window > Package Manager > + > Add package from disk...
- Navigate to the package folder and select
package.json.
Quick Start (using the Sample)
The Samples folder contains a ready-to-use console setup. After installing the package, import the sample from the Package Manager (Reka Debug Console > Samples > Basic Setup > Import).
The sample includes:
| Item | Description |
|---|---|
Prefabs/Console.prefab |
A preconfigured Console with UI, input field, and buttons. Drag it into any scene. |
Prefabs/RandomObject.prefab |
An example GameObject that subscribes to a command. |
ScriptableObjects/ConsoleSettingsDefault.asset |
Default settings with the sample command already registered. |
ScriptableObjects/Commands/test.random.hello.asset |
A sample Command asset. |
Scene/Test.unity |
A test scene with everything wired up. |
Steps
- Open the sample scene
Test.unity, or dragConsole.prefabinto your own scene. - Press Play, then press F3 to toggle the console.
- Type
test.random.helloand press Enter. TheRandomObjectin the scene will log the result.
Creating New Commands
- Right-click in the Project window > Create > DebugConsole > Command.
- Fill in the fields:
- Command Name ā a display name (e.g. "Spawn Enemy").
- Command Description ā what the command does.
- Command Extension ā the identifier users type in the console (e.g.
debug.spawn.enemy). Only letters, numbers, and dots are allowed.
- Open your ConsoleSettings asset (e.g.
ConsoleSettingsDefault) and add the new Command to the Registered Commands list.
Subscribing to a Command
To run your own logic when a command is executed, request the command from the Console singleton and subscribe to its event:
using UnityEngine;
using Reka.Runtime.CommandSO;
public class MyHandler : MonoBehaviour
{
private void Start()
{
// Request a registered command by its extension
Command command = Console.Instance.RequestCommand("debug.spawn.enemy");
if (command != null)
{
command.OnCommandExecuted += OnSpawnEnemy;
}
}
private void OnSpawnEnemy(string commandExtension, string[] args)
{
// args contains everything after the command extension, split by space
Debug.Log($"Spawning enemy! Args: {string.Join(", ", args)}");
}
}
Console.Instance.RequestCommand(extension)returns theCommandScriptableObject registered with that extension, ornullif not found.command.OnCommandExecutedfires when the user types and submits that command. The first parameter is the extension string; the second is an array of space-separated arguments.
Package Structure
com.reka.debug.console/
āāā package.json
āāā README.md
āāā Runtime/
ā āāā Reka.Debug.asmdef
ā āāā Command/
ā ā āāā Command.cs
ā āāā ConsoleSettings/
ā āāā ConsoleSettings.cs
āāā Samples~/
āāā Reka.Debug.Sample.asmdef
āāā Art/
āāā Prefabs/
ā āāā Console.prefab
ā āāā RandomObject.prefab
āāā Scripts/
ā āāā RandomObject.cs
ā āāā Console/
ā āāā Console.cs
ā āāā ConsoleView.cs
āāā Scene/
ā āāā Test.unity
āāā ScriptableObjects/
āāā ConsoleSettingsDefault.asset
āāā Commands/
āāā test.random.hello.asset
License
See LICENSE for details.
No comments yet. Be the first!