Пример #1
0
        public void AddAEditorWindowBase <EditorWindowBase>(string path, EditorIcon icon = null) where EditorWindowBase : AEditorWindowBase
        {
            AEditorWindowBase aEditorWindowBase = (AEditorWindowBase)Activator.CreateInstance(typeof(EditorWindowBase), new object[] { this });

            if (icon == null)
            {
                OdinMenuTree.Add(path, aEditorWindowBase);
            }
            else
            {
                OdinMenuTree.Add(path, aEditorWindowBase, icon);
            }
            aEditorWindowBaseList.Add(aEditorWindowBase);
        }
Пример #2
0
        public void OnSelectionChanged(SelectionChangedType selectionChangedType)
        {
            switch (selectionChangedType)
            {
            case SelectionChangedType.ItemRemoved:
                break;

            case SelectionChangedType.ItemAdded:
                if (OdinMenuTree.Selection.SelectedValue != null)
                {
                    current = (AEditorWindowBase)OdinMenuTree.Selection.SelectedValue;
                    current.OnEnable();
                }
                break;

            case SelectionChangedType.SelectionCleared:
                if (current != null)
                {
                    current.OnDisable();
                    current = null;
                }
                break;
            }
        }