Performs OMIDIV-specific ImGui operations, such as setup, base UI drawing, and events.
More...
|
static void | AddMainMenuTab (string name) |
| Adds a tab to the main menu bar if it doesn't already exist.
|
|
static void | RemoveMainMenuTab (string name) |
| Removes a tab from the main menu bar.
|
|
|
static bool | IsEnabled = true [get, set] |
| Whether the GUI is enabled.
|
|
static bool | IsDebugEnabled [get, set] |
| Whether debug stuff should be drawn.
|
|
|
static Action | Draw |
| Called when the UI is drawn. Modify the UI by subscribing to this event.
|
|
static Action< string > | DrawMainMenuItems |
| Called with the name of the tab for each main menu tab.
|
|
Performs OMIDIV-specific ImGui operations, such as setup, base UI drawing, and events.
◆ AddMainMenuTab()
static void ImGuiManager.AddMainMenuTab |
( |
string | name | ) |
|
|
static |
Adds a tab to the main menu bar if it doesn't already exist.
- Parameters
-
It is recommended to call this in OnEnable
, and RemoveMainMenuTab(string) in OnDisable
.
◆ RemoveMainMenuTab()
static void ImGuiManager.RemoveMainMenuTab |
( |
string | name | ) |
|
|
static |
Removes a tab from the main menu bar.
- Parameters
-
name | The tab title to remove. |
Not removing a tab could result in the tab remaining in subsequent scenes.
◆ IsEnabled
bool ImGuiManager.IsEnabled = true |
|
staticgetset |
Whether the GUI is enabled.
Draw will not be called if not enabled.
◆ Draw
Called when the UI is drawn. Modify the UI by subscribing to this event.
OmidivComponent.DrawGUI is subscribed to this event.
◆ DrawMainMenuItems
Action<string> ImGuiManager.DrawMainMenuItems |
|
static |
Called with the name of the tab for each main menu tab.
The current version of ImGui doesn't support calling BeginMainMenuBar multiple time to append, instead just overwriting. Additionally, it doesn't support appending with BeginMenu with the same name (at least not in the current version).
void MyDrawMenuItems(string menuName) {
switch (menuName) {
case "File":
if (ImGui.MenuItem("Quit")) Application.Quit(); break;
...
}
}
- See also
- AddMainMenuTab(string)
The documentation for this class was generated from the following file:
- L:/Coding/Unity/OMIDIV/Assets/Scripts/ImGuiManager.cs