12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- 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<AssetBundleUtilityWindow>(inspectorType);
- window.titleContent = new GUIContent("AssetBundleUtility");
- window.Show();
- }
-
- private void OnEnable()
- {
- Instance = InstanceManager.SearchInstance<AssetBundleUtility>();
- 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();
- }
- }
- }
|