Esempio n. 1
0
    public void ShowWindow(string uiName, Type type, Func <BaseUI> _createFun = null,
                           object param    = null, List <string> hideWinds   = null,
                           bool hideDotDel = false, Action <BaseUI> callback = null)
    {
        if (hideWinds != null && hideWinds.Contains(uiName))
        {
            hideWinds.Remove(uiName);
        }
        if (_createFun == null)
        {
            _createFun = () =>
            {
                return(Activator.CreateInstance(type) as BaseUI);
            };
        }
        CommandData cmd = CommandData.CreateShow(uiName, _createFun, param, callback);

        mCmds.Add(cmd);
        if (hideWinds != null)
        {
            for (int i = 0; i < hideWinds.Count; i++)
            {
                BaseUI wind = GetWindow(hideWinds[i]);
                if (wind != null)
                {
                    if (wind.isDotDel && !hideDotDel)
                    {
                        hideWinds.RemoveAt(i);
                        i--;
                    }
                }
            }
            CommandData hideCmd = CommandData.CreateHideList(hideWinds);
            mCmds.Add(hideCmd);
        }
    }