MANUAL / Extend the editor / Samples
Samples
Small, commented sample plugins, one per capability. Each is tested to build, load, work and hot-reload, and New Editor Plugin can start from any of them.
C# samplesPlugins/Samples/CSharp
Native samplesPlugins/SamplePlugin, Plugins/SampleRuntimePlugin, Plugins/Samples/ExternalSample
01
C# samples
In the engine repository under Plugins/Samples/CSharp. Tools › Plugins › New Editor Plugin (C#)... copies one into your project under a new name when you pick it in Start from.
| Sample | What it shows | Capabilities | Permissions |
|---|---|---|---|
| AssetType | Sample: a custom asset file (.kchecklist) with create, describe, open (an editor panel) and save hooks. | asset-types panels | none |
| BackgroundTask | Sample: long work on a worker thread as an editor task (Tasks panel progress, cancel), with the result handed back on the main thread. | tasks commands panels | none |
| CommandWithUndo | Sample: a command (menu, palette, toolbar, shortcut) that arranges the selected entities in a row - one undo step for the whole edit. | commands | scene.read scene.write |
| Importer | Sample: imports a CSV height grid (.csv, one row of heights per line) as a terrain patch mesh (OBJ) through File > Import and content drops. | importers | none |
| PanelAndControls | Sample: a dockable panel that uses every control of the plugin UI API (text, buttons, inputs, sliders, combo, colour, progress, sections, tables, trees, tooltips, theme). | panels | none |
| SettingsPage | Sample: a page in Settings > PLUGINS whose values are saved per user and survive reloads and restarts, and a command that uses them. | settings commands | none |
| ViewportTool | Sample: a viewport tool that measures distances on the ground with two clicks and draws gizmo lines and labels (selection axes and names). | viewport-tools | scene.read |
02
Native samples
| Sample | Shows |
|---|---|
Plugins/SamplePlugin | An editor plugin in C++: commands and a toolbar button, a panel and a settings page, an importer and exporter, an asset type, a measuring viewport tool, a background service, automation steps and a loopback echo server. |
Plugins/SampleRuntimePlugin | A runtime plugin: a Spinner component with fields in the Inspector and two game systems. |
Plugins/Samples/ExternalSample | Both parts in one module, built outside the engine against the exported SDK. |
03
Run a sample
- Open a project and choose Tools › Plugins › New Editor Plugin (C#)....
- Pick the sample in Start from and press Create.
- The plugin builds and loads; open its folder in your code editor and change it.
See Your first C# plugin for the full walk-through.
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.