internal void SetPriorityWindow(WindowParaLayer priorityParaLayer) { this.priorityParaLayer = priorityParaLayer; priorityParaLayer.ShadowClicked -= PopupsShadowClicked; priorityParaLayer.ShadowClicked += PopupsShadowClicked; }
private static WindowParaLayer CreatePriorityWindowLayer() { WindowParaLayer result = CreateUIObject <WindowParaLayer>("Priority Window Layer"); Image background = CreateUIObject <Image>("Background Shadow"); background.color = new Color(0, 0, 0, 0.7f); background.transform.SetParent(result.transform, false); background.gameObject.SetActive(false); result.SetBackgroundShadow(background.gameObject); return(result); }
public static UIFrame CreateDefaultUIFrame() { GameObject uiFrame = new GameObject("UI Frame"); UIFrame result = uiFrame.AddComponent <UIFrame>(); Camera camera = CreateCamera(); camera.transform.SetParent(uiFrame.transform); EventSystem eventSystem = CreateEventSystem(); eventSystem.transform.SetParent(uiFrame.transform); Canvas mainCanvas = CreateCanvas(camera); mainCanvas.transform.SetParent(uiFrame.transform); WindowLayer windowLayer = CreateWindowLayer(); windowLayer.transform.SetParent(mainCanvas.transform, false); PanelLayer panelLayer = CreatePanelLayer(); panelLayer.transform.SetParent(mainCanvas.transform, false); WindowParaLayer priorityWindowLayer = CreatePriorityWindowLayer(); priorityWindowLayer.transform.SetParent(mainCanvas.transform, false); windowLayer.SetPriorityWindow(priorityWindowLayer); GameObject prioritaryPanelLayer = CreateUIObject("Prioritary Panel Layer"); prioritaryPanelLayer.transform.SetParent(mainCanvas.transform, false); GameObject tutorialPanelLayer = CreateUIObject("Tutorial Panel Layer"); tutorialPanelLayer.transform.SetParent(mainCanvas.transform, false); GameObject blockerPanelLayer = CreateUIObject("Blocker Panel Layer"); blockerPanelLayer.transform.SetParent(mainCanvas.transform, false); panelLayer.PriorityLayers = new PanelPriorityLayerList(new List <PanelPriorityLayerListEntry>() { new PanelPriorityLayerListEntry(PanelPriority.Prioritary, prioritaryPanelLayer.transform), new PanelPriorityLayerListEntry(PanelPriority.Tutorial, tutorialPanelLayer.transform), new PanelPriorityLayerListEntry(PanelPriority.Blocker, blockerPanelLayer.transform) }); return(result); }