HookUIManager API
The HookUIManager is the singleton that orchestrates the entire system.
Note: While HookUI is designed to work without code, you can drive it entirely from code if you wish.
Accessing the Instance
HookUIManager.Instance
Core Methods
Initialize()
Starts the flow inside a coroutine, jumping to the definition of the Start Node in the Graph.
- Usually called automatically if "Initialize On Start" is checked in the Inspector.
TransitionToScreen(ScreenNodeData node, bool isBackMove)
- Internal usage mostly, but can be used to force a jump.
- Handles
Show()/Hide()logic.
GoBack()
Pops the navigation history stack and returns to the previous screen.
HookUIManager.Instance.GoBack();
OnButtonPressed(string buttonID)
Simulates a button press. Useful if you have a physical button or keyboard input that should trigger a UI navigation event.
if (Input.GetKeyDown(KeyCode.Escape))
{
// Simulate pressing the "Back" button ID
HookUIManager.Instance.OnButtonPressed("Back");
}
Events
OnNavigatedToNodeID: Subscribe to know whenever the screen changes.
HookUIManager.Instance.OnNavigatedToNodeID += (nodeID) => {
Debug.Log($"We just arrived at: {nodeID}");
};