ImGuiSamples Plugin
The ImGuiSamples plugin demonstrates the integration of Dear ImGui library with UnigineEditor and the use of the Editor API to create complex custom tools for solving various tasks.
The plugin creates its own window in UnigineEditor, this window has three tabs, each with a separate sample.
Spline Editor#
This sample demonstrates how to use the Editor's Undo/Redo system via the API, work with hotkeys, and implement custom visualization, using spline editing as an example.
Enabling the Edit Mode option activates the spline editor. The following actions associated with remappable hotkeys (Windows -> Settings -> Hotkeys) are available:
- LMB - Select point
- Shift + LMB - Create new point to the end of spline or add/remove point from selection
- Del - Remove point
- F - Focus on selected point
- Ctrl + Z - Undo
- Ctrl + Y - Redo
Editor (Immediate Mode)#
This sample demonstrates how to work with the Editor and Engine's widgets in immediate mode (in ImGui-like style) using the EditorImmediate class. Programming in this mode is simple, but it has a number of limitations. This mode is recommended for prototyping or simple plugins.
At the center of the world you'll see four connected points that form a polygon. Click Edit Mode to show manipulators for each point. In this mode, you can move points using manipulators and focus on the polygon using the F key shortcut. The current position of each point (X, Y, Z) is updated each frame in the widget at the top-left corner of the viewport.
Components#
This sample demonstrates how to work with C++ components right in the Editor. Simply click Initialize the ComponentSystem and the C++ Component System will automatically create the NodeRotation component (property). Then you can assign it to any node and it will start rotating immediately (right in the Editor!). The component offers 3 sliders enabling you to adjust rotation rate for X, Y, and Z axes.