using RebootKit.Engine;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;

namespace SzafaKitEditor.Oracle {
    [CustomEditor(typeof(RR))]
    public class SzKEngineEditor : Editor {
        private EngineConfigAsset _engineConfigAsset;

        public override VisualElement CreateInspectorGUI() {
            VisualElement inspector = new VisualElement();

            _engineConfigAsset = Resources.Load<EngineConfigAsset>(RConsts.EngineConfigResourcesPath);
            if (_engineConfigAsset == null) {
                inspector.Add(new Label($"Couldn't load engine config from resources: {RConsts.EngineConfigResourcesPath}"));
                return inspector;
            }

            inspector.Add(new Label("Config:"));
            InspectorElement.FillDefaultInspector(inspector, new SerializedObject(_engineConfigAsset), this);
            return inspector;
        }
    }
}