using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; using AtlasUtility; using UnityEditor; using UnityEngine; public class LabelUtilityWindow : EditorWindow { #region Config protected LabelUtility Instance; protected SerializedProperty Prefabs; protected SerializedProperty TextAsset; protected SerializedObject SerializedObject; #endregion [MenuItem("DashGame/LabelUtility")] protected static void ShowWindow() { Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); LabelUtilityWindow window = GetWindow(inspectorType); window.titleContent = new GUIContent("LabelUtility"); window.Show(); } private void OnEnable() { Instance = InstanceManager.SearchInstance(); SerializedObject = new SerializedObject(Instance); Prefabs = SerializedObject.FindProperty("Prefabs"); TextAsset = SerializedObject.FindProperty("TextAsset"); } private void OnGUI() { SerializedObject.Update(); EditorGUILayout.PropertyField(Prefabs, new GUIContent("UIPrefab"), true); EditorGUILayout.PropertyField(TextAsset, new GUIContent("TextAsset")); if (GUILayout.Button("CreateLabels")) { Instance.CreateLabels(); } SerializedObject.ApplyModifiedProperties(); } }