Extensions provide a simple way to build plug-and-play modules for NjConsole, allowing your features to be easily integrated into different projects or shared within the community.
Thanks to the modular design, you can pick and choose only the features or extensions that are relevant for your project, keeping your console lightweight and focused.
You can find some extensions here:
https://github.com/Ninjadini/njconsole/tree/main/extension-modules
Each extension will usually include a README or comments explaining how to include it in your project.
Note: This is still early days, so there may not be much there yet.
To add your own extension:
Project Settings
> NjConsole
> Extension Modules
, add your new class.Here’s a simple example that registers an option menu item:
[Serializable]
public class ExampleExtension : IConsoleExtension
{
void IConsoleModule.OnAdded(ConsoleModules modules)
{
var catalog = modules.GetOrCreateModule<ConsoleOptions>().CreateCatalog();
catalog.AddButton("Extensions/Say Hello", () =>
{
Debug.Log("Hello!");
});
}
}