using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; using UnityEngine.UIElements; using UnityEditor.UIElements; using UnityEngine.Localization; public enum selectionType { Questline, Quest, Step, Dialogue, } public class QuestEditorWindow : EditorWindow { private Image actorPreview; private QuestSO currentSeletedQuest; QuestlineSO selectedQuestLine; int idQuestlineSelected; int idQuestSelected; [MenuItem("ChopChop/QuestEditorWindow")] public static void ShowWindow() { Debug.Log("Show Window"); QuestEditorWindow wnd = GetWindow(); wnd.titleContent = new GUIContent("QuestEditorWindow"); // Sets a minimum size to the window. wnd.minSize = new Vector2(250, 250); } public static void ShowArtistToolWindow() { // Opens the window, otherwise focuses it if it’s already open. QuestEditorWindow window = GetWindow(); // Adds a title to the window. Debug.Log("Show Window"); window.titleContent = new GUIContent("QuestEditorWindow"); // Sets a minimum size to the window. window.minSize = new Vector2(250, 250); //window.SetTool(); } public void CreateGUI() { VisualElement root = rootVisualElement; Debug.Log("Create GUI"); // Import UXML var visualTree = Resources.Load("QuestEditorWindow"); root.Add(visualTree.CloneTree()); //Add Image VisualElement preview = root.Q("actor-preview"); actorPreview = new Image(); preview.Add(actorPreview); //Import USS var styleSheet = Resources.Load("QuestEditorWindow"); root.styleSheets.Add(styleSheet); //Register button event Button refreshQuestPreviewBtn = root.Q