Пример #1
0
 private void CheckEditorChange()
 {
     if (indexState.selectedIDs.Count != 0)
     {
         //Draw one editor
         var selectEditor = libIndex.GetEditor(indexState.selectedIDs[0]);
         if (CurrentEditor == selectEditor)
         {
             return;
         }
         else
         {
             if (CurrentEditor != null)
             {
                 CurrentEditor.OnDisable();
             }
             CurrentEditor = selectEditor;
             EditorPrefs.SetInt(IndexKey, indexState.selectedIDs[0]);
             if (selectEditor != null)
             {
                 selectEditor.position = EditorContent.contentRect;
                 selectEditor.OnEnable(this);
             }
         }
     }
 }
Пример #2
0
        public void RefreshTreeData(SeanLibManager drawer)
        {
            var editorTypes = AssemblyTool.FindTypesInCurrentDomainWhereAttributeIs <CustomSeanLibEditor>();

            editorTypes.RemoveAll(e => ReflecTool.GetAttribute <CustomSeanLibEditor>(e).IsDoc != isdoc);
            editorTypes.Sort((l, r) =>
            {
                return(ReflecTool.GetAttribute <CustomSeanLibEditor>(l).order - ReflecTool.GetAttribute <CustomSeanLibEditor>(r).order);
            });
            editors = new List <SeanLibEditor>(editorTypes.Count);
            foreach (var item in editorTypes)
            {
                SeanLibEditor editor = ReflecTool.Instantiate(item) as SeanLibEditor;
                //editor.OnEnable(drawer);
                editors.Add(editor);
            }
            Reload();
        }