示例#1
0
    void OnOpen(CUILoadState uiState, params object[] args)
    {
        if (uiState.IsLoading)
        {
            uiState.OpenWhenFinish = true;
            uiState.OpenArgs       = args;
            return;
        }

        CUIController uiBase = uiState.UIWindow;

        Action doOpenAction = () =>
        {
            if (uiBase.gameObject.activeSelf)
            {
                uiBase.OnClose();
            }

            uiBase.gameObject.SetActive(true);

            uiBase.OnOpen(args);

            if (OnOpenEvent != null)
            {
                OnOpenEvent(uiBase);
            }
        };

        doOpenAction();
    }
示例#2
0
    void OnOpen(CUILoadState uiState, params object[] args)
    {
        if (OpenWindowEvent != null)
        {
            OpenWindowEvent(uiState.UIType);
        }

        CUIController uiBase = uiState.UIWindow;

        uiBase.OnPreOpen();
        if (uiBase.gameObject.activeSelf)
        {
            uiBase.OnClose();
        }
        else
        {
            uiBase.gameObject.SetActive(true);
        }

        uiBase.OnOpen(args);
    }