public void Create(Alert alert) { UiRoot root = UiManager.Instance.uiRoot; root.LoadMenu <AlertRegion>(typeof(AlertMenu)); if (root.GetMenuRegion(out AlertRegion alertRegion)) { alertRegion.OnLoaded += menu => { (menu as AlertMenu)?.Attach(alert); }; } }
public void Create(Window window) { UiRoot root = UiManager.Instance.uiRoot; root.LoadMenu <WindowRegion>(typeof(WindowMenu)); if (root.GetMenuRegion(out WindowRegion windowRegion)) { windowRegion.OnLoaded += menu => { (menu as WindowMenu)?.Attach(window); }; } }