public OpenParam(string uiName, int siblingIndex, PanelUi dialog, UiInitType initType) { Assert.IsNotNull(uiName, "UI名不能为null"); UiName = uiName; Dialog = dialog; InitType = initType; SiblingIndex = siblingIndex; }
public static T OpenUi <T>(string uiName, string after, bool dialog = true, UiInitType act = 0) where T : PanelUi { var index = _ActiveUI.FindIndex(x => x.EntityName == after); if (index != _ActiveUI.Count) { return(OpenUi <T>(new OpenParam(uiName, index + 1, dialog ? _ActiveUI[index] : null, act))); } Debug.LogWarning($"未找到after名为 {after} 的UI"); return(null); }
public void InitRect(UiInitType action) { if (action.HasFlag(UiInitType.MiddleAnchor)) { RectTrans.anchorMin = RectTrans.anchorMax = Vector2.one / 2; } if (action.HasFlag(UiInitType.FillAnchor)) { RectTrans.anchorMax = Vector2.one; RectTrans.anchorMin = Vector2.zero; } if (action.HasFlag(UiInitType.FillSize)) { RectTrans.offsetMin = RectTrans.offsetMax = Vector2.zero; } if (action.HasFlag(UiInitType.PositionMiddleOfAnchor)) { RectTrans.anchoredPosition = Vector2.zero; } }
public static T OpenUi <T>(string uiName, UiInitType act = 0) where T : PanelUi { return(OpenUi <T>(new OpenParam(uiName, _UIContainer.childCount, null, act))); }
public static PanelUi OpenUi(string uiName, string after, bool dialog = true, UiInitType act = 0) { return(OpenUi <PanelUi>(uiName, after, dialog, act)); }
public static PanelUi OpenUi(string uiName, UiInitType act = 0) { return(OpenUi <PanelUi>(uiName, act)); }
public static PanelUI OpenUI(string uiName, UiInitType act = 0) { return(OpenUI <PanelUI>(uiName, act)); }