TriggerEdge / dear-imgui-unity

Unity package for Dear ImGui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dear ImGui for Unity

UPM package for the immediate mode GUI library, Dear ImGui (https://github.com/ocornut/imgui).

Usage

  • Add package from git URL: https://github.com/realgamessoftware/dear-imgui-unity.git .
  • Add a DearImGui component to one of the objects in the scene.
  • When using the Universal Render Pipeline, add a Render Im Gui Feature render feature to the renderer asset. Assign it to the render feature field of the DearImGui component.
  • 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();
        }
    }

See Also

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/realgamessoftware/dear-imgui-unity-dev .

About

Unity package for Dear ImGui

License:MIT License


Languages

Language:C# 99.4%Language:ShaderLab 0.3%Language:HLSL 0.2%