UPM package for the immediate mode GUI library, Dear ImGui (https://github.com/ocornut/imgui).
- Add package from git URL: https://github.com/TylkoDemon/dear-imgui-unity.git .
- Drag an
ImGui Pass
prefab that can be found atPackages/Dear ImGui/Resources/ImGui Pass.prefab
into your Bootstrap/Entry scene (it invokes DontDestroyOnLoad on itself). - When using the Universal Render Pipeline, add a
Render Im Gui Feature
render feature to the renderer asset. Assign it to therender feature
field of the DearImGui component. - When using the HDRP, no extra setup is needed. Prefab is preconfigured to work just fine.
- When using the Inbuilt Renderer, no extra setup is needed.
- Subscribe to the
ImGuiUn.Layout
event and use ImGui functions. - Example script:
using UnityEngine; using ImGuiNET; public class DearImGuiDemo : MonoBehaviour { void OnEnable() { ImGuiUn.Layout += OnLayout; } void OnDisable() { ImGuiUn.Layout -= OnLayout; } void OnLayout() { ImGui.ShowDemoWindow(); } }
Full Dear Imgui implementation (based on ImGui.NET), version 1.76 with Docking features.
This package uses Dear ImGui C bindings by cimgui and the C# wrapper by ImGui.NET.
The development project for the package can be found at https://github.com/TylkoDemon/dear-imgui-unity.
Full setup with examples of this package can be found at https://github.com/TylkoDemon/Dear-Imgui-For-Unity
To draw IMGUI after UI in Camera-Space, this package utilizes HDRP-UI-Camera-Stacking which can be found at https://github.com/alelievr/HDRP-UI-Camera-Stacking
To draw Dear Imgui after Screen-Space Overlay UI, you need to use RenderingMode.IntoRenderTexture mode, which actually uses another Screen-Space Overlay canvas set to maximum render order, and draws our Imgui by using Raw Image. This feature has been tested only on URP.
This fork of dear-imgui-unity is currently developed by using Unity 2022.3.10f1