namespace assetBundleUtility { using System; using UnityEditor; using UnityEngine; public class AssetBundleUtilityWindow : EditorWindow { #region Config protected Vector2 ScrollPosition; protected GUIStyle TitleGUIStyle; protected AssetBundleUtility Instance; protected SerializedObject SerializedObject; protected SerializedProperty AssetBundleGroups; #endregion [MenuItem("DashGame/AssetBundleUtility")] protected static void ShowWindow() { Type inspectorType = Type.GetType("UnityEditor.InspectorWindow,UnityEditor.dll"); AssetBundleUtilityWindow window = GetWindow(inspectorType); window.titleContent = new GUIContent("AssetBundleUtility"); window.Show(); } private void OnEnable() { Instance = InstanceManager.SearchInstance(); SerializedObject = new SerializedObject(Instance); AssetBundleGroups = SerializedObject.FindProperty("AssetBundleGroups"); TitleGUIStyle = new GUIStyle { fontSize = 20, alignment = TextAnchor.MiddleCenter, normal = { textColor = new Color(0.75f, 0.75f, 0.75f, 1) } }; } private void OnGUI() { SerializedObject.Update(); ScrollPosition = EditorGUILayout.BeginScrollView(ScrollPosition); EditorGUILayout.LabelField("AssetBundleUtility", TitleGUIStyle, GUILayout.Height(30)); EditorGUILayout.PropertyField(AssetBundleGroups, new GUIContent(AssetBundleGroups.displayName), true); EditorGUILayout.EndScrollView(); SerializedObject.ApplyModifiedProperties(); } } }