using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using BITKit.UX; using UnityEditor; using UnityEditor.UIElements; using UnityEngine; using UnityEngine.UIElements; using Object = UnityEngine.Object; namespace BITKit.GameEditor { public class ScriptableObjectGroupEditor : EditorWindow where T : ScriptableObject { protected virtual string AssetsPath => $"Assets/Artists/"; protected virtual string ExportPathKey => $"{typeof(T).Name}.ExportPath"; protected virtual string ExportNameKey=> $"{typeof(T).Name}.ExportName"; protected readonly List List=new(); protected ListView listView { get; private set; } protected VisualElement container { get; private set; } protected VisualElement _actionContainer { get; private set; } protected TextField _newNameField { get; private set; } private Button _createButton; protected virtual void OnEnable() { RebuildList(); rootVisualElement.style.flexDirection = FlexDirection.Row; var css = AssetDatabase.LoadAssetAtPath(BITEditorUtils.InspectorPath); rootVisualElement.styleSheets.Add(css); var leftSlider = rootVisualElement.Create(); leftSlider.name = "LeftSlider"; var toolbarContainer = leftSlider.Create(); toolbarContainer.style.alignSelf = Align.Auto; toolbarContainer.style.flexDirection = FlexDirection.Row; var refreshButton = toolbarContainer.Create