-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Hello,
I’m experiencing an issue with the integration of ImGui in my Unity project. I have a script using UImGui, and even when I set the p_open variable to false, the window still appears. And when i click the top right cross for closing the windows, the windows stay open (the windows blink ).
To Reproduce
Steps to reproduce the behavior:
- Create a new scene
- Add SampleDemoWindow
- Attach linked script to SampleDemoWindow
- Setup UImGui script (Render feature, camera )
- Play
- The window should be close but it appears
Version/Branch of UImGui:
Version: 5.0.0
Unity Version
2022.3.19f1
Render pipeline (HDRP / URP / Built-in)
URP
Expected behavior
The window should not be displayed when p_open is set to false.
Standalone, minimal, complete and verifiable example:
using UnityEngine;
using ImGuiNET;
public class TestUImGUI : MonoBehaviour
{
[SerializeField]
private UImGui.UImGui _uimGuiInstance;
private bool _isOpen = false;
private void Awake()
{
if (_uimGuiInstance == null)
{
Debug.LogError("Must assign a UImGuiInstance or use UImGuiUtility with Do Global Events on UImGui component.");
}
_uimGuiInstance.Layout += OnLayout;
}
private void OnLayout(UImGui.UImGui obj)
{
_isOpen = false;
if (!ImGui.Begin("Test Window", ref _isOpen))
{
ImGui.End();
return;
}
ImGui.Text("Hello, World!");
ImGui.End();
}
private void OnDisable()
{
_uimGuiInstance.Layout -= OnLayout;
}
}
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working