public static Panel OpenPanel <T>(string panelName, T request) { PanelManager inst = Instance; if (inst == null) { return(null); } PanelAsset asset = inst.GetAsset(panelName); if (asset == null || !asset.IsUsable) { return(null); } else if (asset.Mode == EPanelMode.Dialog) { return(inst.OpenPanelAsDialog(asset, request)); } else if (asset.Mode == EPanelMode.Status || asset.Mode == EPanelMode.TopStatus) { return(inst.OpenPanelAsStatus(asset, request)); } else if (asset.Mode == EPanelMode.Normal) { return(inst.OpenPanelAsNormal(asset, request)); } else { return(null); } }
public static Panel OpenPanel(int id) { PanelManager inst = Instance; if (inst == null) { return(null); } PanelAsset asset = inst.GetAsset(id); if (asset == null || !asset.IsUsable) { return(null); } else if (asset.Mode == EPanelMode.Dialog) { return(inst.OpenPanelAsDialog(asset, PanelIntentData.NONE)); } else if (asset.Mode == EPanelMode.Status || asset.Mode == EPanelMode.TopStatus) { return(inst.OpenPanelAsStatus(asset, PanelIntentData.NONE)); } else if (asset.Mode == EPanelMode.Normal) { return(inst.OpenPanelAsNormal(asset, PanelIntentData.NONE)); } else { return(null); } }