Exemplo n.º 1
0
    /// <summary>
    /// 显示提示框
    /// </summary>
    /// <param name="uiData"></param>
    /// <param name="parent"></param>
    public static void Show(MessageBoxData uiData, WindowNode parent = null)
    {
        WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName);

        if (uiData.LuaCallBack != null)
        {
            System.Action <MessageBoxResult> luaCallBack = (result) =>
            {
                uiData.LuaCallBack((int)result);
            };

            if (uiData.CallBack != null)
            {
                uiData.CallBack += luaCallBack;
            }
            else
            {
                uiData.CallBack = luaCallBack;
            }
        }


        if (parent != null)
        {
            initParam.ParentNode = parent;
        }
        else
        {
            initParam.NodeType = BaseNodeType.Propmt;
        }
        initParam.WindowData = uiData;
        WindowManager.Instance.OpenWindow(initParam);
    }
Exemplo n.º 2
0
 /// <summary>
 /// 打开提示界面
 /// </summary>
 static void OpenBubblePrompt()
 {
     if (m_Instance == null && !isCreated)
     {
         isCreated = true;
         WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName);
         initParam.NodeType = BaseNodeType.Tips;
         WindowManager.Instance.OpenWindow(initParam);
     }
 }
Exemplo n.º 3
0
 public WindowNode(WindowNodeInitParam initParam)
 {
     ChildWindows    = new List <WindowNode>();
     WindowName      = initParam.WindowName;
     WindowAssetName = initParam.WindowAssetName;
     IsRootNode      = false;
     m_WindowData    = initParam.WindowData;
     ParentWindow    = initParam.ParentNode;
     RootNodeType    = initParam.ParentNode.RootNodeType;
     this.m_WindowLoadComplatedCallBack = initParam.LoadComplatedCallBack;
 }
Exemplo n.º 4
0
 /// <summary>
 /// 显示数据加载界面
 /// </summary>
 public static void Show(System.Action <WindowNode> complatedCallBack = null)
 {
     if (openedWindowNode == null)
     {
         WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName);
         initParam.NodeType = BaseNodeType.Loading;
         initParam.LoadComplatedCallBack = complatedCallBack;
         openedWindowNode = WindowManager.Instance.OpenWindow(initParam);
         HotFix.HotFixUpdate.HotfixProgressChangedEvent += HotFixUpdate_HotfixProgressChangedEvent;
     }
 }
Exemplo n.º 5
0
 /// <summary>
 /// 显示数据加载界面
 /// </summary>
 /// <param name="timeOut"></param>
 /// <param name="timeOutCallBack"></param>
 public static void Show(int timeOut = 5, System.Action timeOutCallBack = null)
 {
     if (openedWindowNode == null)
     {
         WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName);
         initParam.NodeType = BaseNodeType.AboveNormal;
         LoadingDataUIData uiData = new LoadingDataUIData();
         uiData.MaxLastTime = timeOut;
         uiData.MaxTimeCloseWindowCallBack = timeOutCallBack;
         initParam.WindowData = uiData;
         openedWindowNode     = WindowManager.Instance.OpenWindow(initParam);
     }
 }
Exemplo n.º 6
0
    /// <summary>
    /// 开启UI
    /// </summary>
    /// <param name="initParam"></param>
    /// <returns></returns>
    public WindowNode OpenWindow(WindowNodeInitParam initParam)
    {
        if (initParam == null)
        {
            return(null);
        }
        if (initParam.ParentNode == null)
        {
            initParam.ParentNode = GetBaseWindowNodeByNodeType(initParam.NodeType);
        }
        WindowNode windowNode = new WindowNode(initParam);

        windowNode.ParentWindow = initParam.ParentNode;
        SetWindowNodeInfo(windowNode, initParam.NearNode, initParam.NearNodeIsPreNode);
        ResetAllWindowIndex();
        // 统计SDK
        EventDispatcher.Instance.TriggerEvent("OpenWindowEvent", initParam.WindowName);
        return(windowNode);
    }
Exemplo n.º 7
0
    /// <summary>
    /// 显示提示框
    /// </summary>
    /// <param name="uiData"></param>
    /// <param name="parent"></param>
    public static void Show(MessageBoxData uiData, WindowNode parent = null)
    {
        string  UIAssetName_X = "MessageBoxUI";
        Vector2 screenSize    = new Vector2(Screen.width, Screen.height);

        if (screenSize.x == 1125 && screenSize.y == 2436)
        {
            UIAssetName_X = "MessageBoxUI_X";
        }
        WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName_X);

        if (uiData.LuaCallBack != null)
        {
            System.Action <MessageBoxResult> luaCallBack = (result) =>
            {
                uiData.LuaCallBack((int)result);
            };

            if (uiData.CallBack != null)
            {
                uiData.CallBack += luaCallBack;
            }
            else
            {
                uiData.CallBack = luaCallBack;
            }
        }


        if (parent != null)
        {
            initParam.ParentNode = parent;
        }
        else
        {
            initParam.NodeType = BaseNodeType.Propmt;
        }
        initParam.WindowData = uiData;
        WindowManager.Instance.OpenWindow(initParam);
    }