using UnityEngine; using UnityEditor; public class PrefabSettingsWindow : EditorWindow { public PrefabCreatorSettings CurrentSettings; [MenuItem("Youssef Tools/Prefab Creator Setup")] public static void ShowWindow() => GetWindow("Setup Window"); private void OnEnable() { string SavedPath = EditorPrefs.GetString("YoussefTool_SettingsPath", ""); if (!string.IsNullOrEmpty(SavedPath)) { CurrentSettings = AssetDatabase.LoadAssetAtPath(SavedPath); } } void OnGUI() { GUILayout.Label("Active Tool Settings", EditorStyles.boldLabel); EditorGUI.BeginChangeCheck(); CurrentSettings = (PrefabCreatorSettings)EditorGUILayout.ObjectField( "Prefab Creator Settings", CurrentSettings, typeof(PrefabCreatorSettings), false); if (EditorGUI.EndChangeCheck()) { string path = AssetDatabase.GetAssetPath(CurrentSettings); EditorPrefs.SetString("YoussefTool_SettingsPath", path); } if (CurrentSettings != null) Editor.CreateEditor(CurrentSettings).OnInspectorGUI(); } }