12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- namespace labelUtility
- {
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text.RegularExpressions;
- using UnityEditor;
- using UnityEngine;
- public class LabelUtilityWindow : EditorWindow
- {
- #region Config
- protected Vector2 ScrollPosition;
- protected LabelUtility Instance;
- protected SerializedProperty LabelSets;
- protected SerializedObject SerializedObject;
- #endregion
- [MenuItem("DashGame/LabelUtility")]
- protected static void ShowWindow()
- {
- Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll");
- LabelUtilityWindow window = GetWindow<LabelUtilityWindow>(inspectorType);
- window.titleContent = new GUIContent("LabelUtility");
- window.Show();
- }
- private void OnEnable()
- {
- Instance = InstanceManager.SearchInstance<LabelUtility>();
- SerializedObject = new SerializedObject(Instance);
- LabelSets = SerializedObject.FindProperty("LabelSets");
- }
- private void OnGUI()
- {
- SerializedObject.Update();
- ScrollPosition = EditorGUILayout.BeginScrollView(ScrollPosition);
- EditorGUILayout.PropertyField(LabelSets, new GUIContent("LabelSets"), true);
- //if (GUILayout.Button("CreateLabelScript"))
- //{
- // LabelUtility.CreateLabelScript(Instance.LabelSets[0]);
- //}
- //if (GUILayout.Button("CreateComponentScript"))
- //{
- // LabelUtility.CreateComponentScript(Instance.LabelSets[0]);
- //}
- //if (GUILayout.Button("CreateLabelFromPrefab"))
- //{
- // LabelUtility.CreateLabelFromPrefab(Instance.LabelSets[0]);
- //}
- //if (GUILayout.Button("CreateComponentsFromPrefab"))
- //{
- // LabelUtility.CreateComponentsFromPrefab(Instance.LabelSets[0], InitPurview.Text, InitPurview.Button, InitPurview.SpriteRenderer);
- //}
- EditorGUILayout.EndScrollView();
- SerializedObject.ApplyModifiedProperties();
- }
- }
- }
|