Exemple #1
0
        public static ListEditorWnd Create(string title, EditorWindow parent, LuaReflect luaReflect, ExcelColHeader header, string vid)
        {
            Rect          rect = new Rect(parent.position.x + parent.position.width + 20, parent.position.y, parent.position.width, parent.position.height);
            ListEditorWnd wnd  = EditorWindow.CreateWindow <ListEditorWnd>(title);

            wnd.position = rect;
            ExcelEditor excelEditor = new ExcelEditor(header.linkEditorUrl);

            wnd.ShowWnd(excelEditor);
            wnd.SetShowRows(excelEditor.GetRowIndexes(header.linkEditorField, vid), true);
            wnd.header     = header;
            wnd.luaReflect = luaReflect;
            return(wnd);
        }
Exemple #2
0
        protected void LinkEditor(ExcelColHeader excelColHeader, DataRowCollection rows, int rowIndex, int colIndex, bool showAll)
        {
            if (childWnd)
            {
                childWnd.Close();
            }
            string vid = rows?[rowIndex][colIndex].ToString();

            if (showAll)
            {
                childWnd = SelectWnd.Create("Select " + excelColHeader.linkEditorLuaKey, this, luaReflect, excelColHeader.linkEditorUrl);
                ((SelectWnd)childWnd).SetSelectDelegate(delegate(string id)
                {
                    OnSelect(id, rowIndex, colIndex);
                });
            }
            else
            {
                childWnd = ListEditorWnd.Create(excelColHeader.linkEditorLuaKey, this, luaReflect, excelColHeader, vid);
            }
        }