Exemple #1
0
 /// <summary>
 /// 关闭UI窗口
 /// </summary>
 /// <param name="type"></param>
 public void CloseWindowUI(WindowUIType type)
 {
     if (windowUIDic.ContainsKey(type))
     {
         windowUIDic[type].SetActive(false);
     }
 }
Exemple #2
0
 public void CloseWindow(WindowUIType type)
 {
     if (m_WinDic.ContainsKey(type))
     {
         StartWindowShow(m_WinDic[type], false);
     }
 }
Exemple #3
0
    /// <summary>
    /// 显示窗口UI
    /// </summary>
    /// <param name="type"></param>
    /// <returns></returns>
    public GameObject ShowWindowUI(WindowUIType type)
    {
        GameObject go = null;

        if (!windowUIDic.ContainsKey(type))
        {
            //枚举名称要与预设名称对应
            go = ResourcesManager.Instance.Load(ResourceType.WindowUI, type.ToString());
            if (go == null)
            {
                return(null);
            }

            windowUIDic.Add(type, go);

            go.transform.parent        = windowUIparent;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            go.transform.eulerAngles   = Vector3.zero;
        }
        else
        {
            go = windowUIDic[type];
        }

        go.SetActive(true);
        return(go);
    }
Exemple #4
0
 public void CloseWindow(WindowUIType windowUIType)
 {
     if (dicWindow.ContainsKey(windowUIType))
     {
         StartShowWindow(dicWindow[windowUIType], false);
     }
 }
Exemple #5
0
 /// <summary>
 /// 关闭窗口
 /// </summary>
 /// <param name="type"></param>
 public void CloseWindow(WindowUIType type)
 {
     if (m_DicWindow.ContainsKey(type))
     {
         StartShowWindow(m_DicWindow[type], false);
     }
 }
    /// <summary>
    /// 打开窗口
    /// </summary>
    /// <param name="type">窗口类型</param>
    /// <returns></returns>
    public GameObject OpenWindow(WindowUIType type)
    {
        if (type == WindowUIType.None)
        {
            return(null);
        }
        if (m_DicWindow.ContainsKey(type) && m_DicWindow[type] == null)
        {
            m_DicWindow.Remove(type);
        }
        GameObject obj = null;

        //如果窗口不存在 则
        if (!m_DicWindow.ContainsKey(type))
        {
            //枚举的名称要和预设的名称对应
            obj = ResourcesMgr.Instance.Load(ResourcesMgr.ResourceType.UIWindow, string.Format("Pan_{0}", type.ToString()), cache: true);
            if (obj == null)
            {
                return(null);
            }
            UIWindowViewBase windowBase = obj.GetComponent <UIWindowViewBase>();
            if (windowBase == null)
            {
                return(null);
            }

            m_DicWindow.Add(type, windowBase);

            windowBase.CurrentUIType = type;
            Transform transParent = null;

            switch (windowBase.containerType)
            {
            case WindowUIContainerType.Center:
                transParent = UISceneCtr.Instance.CurrentUIScene.Container_Center;
                break;
            }

            obj.transform.parent        = transParent;
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localScale    = Vector3.one;
            obj.SetActive(false);

            StartShowWindow(windowBase, true);
        }
        else
        {
            obj = m_DicWindow[type].gameObject;
        }
        ////层级管理
        LayerUIMgr.Instance.SetLayer(obj);
        return(obj);
    }
Exemple #7
0
    public void OpenView(WindowUIType type)
    {
        switch (type)
        {
        case WindowUIType.LogOn:
            OpenLogOnView();
            break;

        case WindowUIType.Reg:
            OpenRegView();
            break;
        }
    }
Exemple #8
0
    public new void OpenView(WindowUIType type)
    {
        switch (type)
        {
        case WindowUIType.GameServerEnter:
            OpenGameServerEnterView();
            break;

        case WindowUIType.GameServerSelect:
            OpenGameServerSelectView();
            break;

        default:
            break;
        }
    }
Exemple #9
0
    public void OpenView(WindowUIType type)
    {
        switch (type)
        {
        case WindowUIType.None:
            break;

        case WindowUIType.LogOn:
            OpenLogOnView();
            break;

        case WindowUIType.Reg:
            OpenRegView();
            break;

        case WindowUIType.GameServerEnter:
            break;

        case WindowUIType.GameServerSelect:
            break;

        case WindowUIType.RoleInfo:
            break;

        case WindowUIType.GameLevelMap:
            break;

        case WindowUIType.GameLevelDetail:
            break;

        case WindowUIType.GameLevelVictory:
            break;

        case WindowUIType.GameLevelFail:
            break;

        case WindowUIType.WorldMap:
            break;

        case WindowUIType.WorldMapFail:
            break;

        default:
            break;
        }
    }
    public void OpenView(WindowUIType windowUIType, Transform windowUiPanelContainerTrans)
    {
        m_windowUiPanelContainerTrans = windowUiPanelContainerTrans;
        switch (windowUIType)
        {
        case WindowUIType.GameLevelMap:
            OpenGameLevelMapView(windowUiPanelContainerTrans);
            break;

        case WindowUIType.GameLevelDetail:
            OpenGameLevelDetailView(windowUiPanelContainerTrans);
            break;

        default:
            break;
        }
    }
    /// <summary>
    /// 打开窗口
    /// </summary>
    /// <returns>The window.</returns>
    /// <param name="type">窗口类型</param>
    public GameObject OpenWindow(WindowUIType type)
    {
        GameObject obj = null;

        if (!dicWindows.ContainsKey(type))
        {
            // 窗口名字必须与窗口类型保持一致
            string windowName = string.Format("pan{0}", type.ToString());
            obj = ResourcesMgr.Instance.Load(ResourcesMgr.ResourceType.UIWindow, windowName, cache: true);;
            if (obj == null)
            {
                Debug.Log(string.Format("Resources load {0} failed", windowName));
                return(null);
            }

            obj.transform.parent        = UIRootMgr.Instance.CurrentUIScene.ContainerCenter;
            obj.transform.localPosition = Vector3.zero;
            obj.transform.localScale    = Vector3.one;
            NGUITools.SetActive(obj, false);

            UIWindowBase windowBase = obj.GetComponent <UIWindowBase>();
            if (windowBase == null)
            {
                return(null);
            }

            windowBase.currentUIType = type;
            dicWindows.Add(type, windowBase);

            StartShowWindow(windowBase, true);
        }
        else
        {
            obj = dicWindows[type].gameObject;
        }

        // 动态调整最上层的界面的层级
        UILayerMgr.Instance.AdjustLayer(obj);

        return(obj);
    }
Exemple #12
0
    /// <summary>
    /// 打开窗口
    /// </summary>
    /// <param name="windowUIType">窗口类型</param>

    /// <returns></returns>
    public GameObject OpenWindow(WindowUIType windowUIType, Transform transParent = null)
    {
        if (windowUIType == WindowUIType.None)
        {
            return(null);
        }
        GameObject obj = null;

        UIBase windowBase = null;

        if (!dicWindow.ContainsKey(windowUIType))
        {
            //前提:枚举的名字必须和预制件的名字一致
            obj = ResourcesMgr.Instance.Load(ResourcesType.UIPrefabs, string.Format("{0}", windowUIType.ToString()), true);
            if (obj == null)
            {
                return(null);
            }
            windowBase = obj.GetComponent <UIBase>();
            if (windowBase == null)
            {
                return(null);
            }
            windowBase.curretnUIType = windowUIType;
            dicWindow.Add(windowUIType, windowBase);
            obj.transform.parent        = transParent;
            obj.transform.localPosition = Vector3.one;
            obj.transform.localScale    = Vector3.one;
            NGUITools.SetActive(obj, false);
        }
        else
        {
            obj        = dicWindow[windowUIType].gameObject;
            windowBase = obj.GetComponent <UIBase>();
        }

        StartShowWindow(windowBase, true);

        return(obj);
    }
Exemple #13
0
 /// <summary>
 /// 关闭并且打开下一个窗口
 /// </summary>
 /// <param name="nextType"></param>
 public virtual void CloseAndOpenNext(WindowUIType nextType)
 {
     this.Close();
 }
Exemple #14
0
 /// <summary>
 /// 打开视图
 /// </summary>
 /// <param name="type"></param>
 public void OpenWindow(WindowUIType type)
 {
     m_SystemCtrlDic[type].OpenView(type);
 }
Exemple #15
0
 protected void OpenView(WindowUIType type)
 {
     WindowUIMgr.Instance.OpenWindow(type);
 }
Exemple #16
0
 public void OpenView(WindowUIType type)
 {
     throw new System.NotImplementedException();
 }
Exemple #17
0
    /// <summary>
    /// 窗口UI加载
    /// </summary>
    /// <param name="type">窗口类型</param>
    /// <returns></returns>
    public GameObject OpenWindow(WindowUIType type)
    {
        if (type == WindowUIType.None)
        {
            return(null);
        }

        GameObject go = null;

        UIWindowBase windowBase = null;

        if (!m_WinDic.ContainsKey(type))
        {
            //这里要去预设的前缀要跟WindowUIType的枚举名称一致
            string prefabName = type.ToString() + "Window";

            go = ResourcesMgr.Instance.Load(ResourcesType.UIWindow, prefabName, true);

            if (go == null)
            {
                return(null);
            }

            //获取该窗口的UIWindowBase
            windowBase = go.GetComponent <UIWindowBase>();

            if (windowBase == null)
            {
                return(null);
            }

            windowBase.curWindowType = type;

            m_WinDic.Add(type, windowBase);

            Transform container = null;

            switch (windowBase.containerType)
            {
            //获取该窗口应该挂在场景UI的哪个九宫格挂点上
            case ContainerType.Center:
                container = SceneUIMgr.Instance.currentUIScene.m_ContainerCenter;
                break;
            }

            go.transform.parent        = container;
            go.transform.localPosition = Vector3.zero;
            go.transform.localScale    = Vector3.one;
            NGUITools.SetActive(go, false);
        }
        else
        {
            windowBase = m_WinDic[type];
            go         = windowBase.gameObject;
        }

        StartWindowShow(windowBase, true);

        //设置层级,最新打开的窗口的层级depth会自动增加层级数量(50为基数),以保证它在视图的最前面
        LayerUIMgr.Instance.SetLayer(go);

        return(go);
    }