Interface DirectorGame Creator 2 Module

#Scripting API

The central runtime entry point is GameCreator.Runtime.InterfaceDirector.InterfaceDirector.Instance.

using GameCreator.Runtime.InterfaceDirector;

// Open an interface
InterfaceHandle handle = InterfaceDirector.Instance.Show(inventoryAsset);

// Close an interface
InterfaceDirector.Instance.Hide(handle);

// Trigger global return
InterfaceDirector.Instance.Return();

#Mutations and Queries

Method Description
Show(asset, options) Opens an interface and returns an InterfaceHandle.
Hide(handle) / Hide(asset) Closes an open interface.
Close(handle, result, reason) Closes an interface with a specific result and close reason.
ShowAndWait(asset, options) Async Task awaitable open returning InterfaceResult.
WaitForClose(handle) Async Task awaiting instance close.
Toggle(asset) Toggles interface open/closed.
HideTop(layer) Closes top interface in specified layer.
ReplaceTop(asset, options) Replaces top interface atomically.
Return() Triggers global Return navigation command.
ClearLayer(layer) Closes all interfaces in a layer.
CloseAll() Closes all interfaces across all layers.

#InterfaceHandle

An InterfaceHandle is a lightweight struct identifying a unique runtime instance:

if (handle.IsValid)
{
    Debug.Log($"Interface is open: {handle.Asset.name}");
}
else if (handle.IsRejected)
{
    Debug.LogWarning($"Open rejected by: {handle.RejectedBy?.name}");
}