AlicizaX/Client/Packages/com.alicizax.unity.resource/Editor/Inspector/ResourceComponentInspector.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2025-01-23 19:06:48 +08:00
using AlicizaX.Editor;
using AlicizaX.Resource.Runtime;
using UnityEditor;
using UnityEngine;
namespace AlicizaX.Resource.Editor
{
[CustomEditor(typeof(ResourceComponent))]
internal sealed class ResourceComponentInspector: ComponentTypeComponentInspector
{
private SerializedProperty m_GamePlayMode;
private GUIContent m_GamePlayModeGUIContent = new GUIContent("资源运行模式");
public override void OnInspectorGUI()
{
base.OnInspectorGUI();
serializedObject.Update();
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
{
EditorGUILayout.PropertyField(m_GamePlayMode, m_GamePlayModeGUIContent);
}
EditorGUI.EndDisabledGroup();
serializedObject.ApplyModifiedProperties();
Repaint();
}
protected override void RefreshTypeNames()
{
RefreshComponentTypeNames(typeof(IResourceManager));
}
protected override void Enable()
{
m_GamePlayMode = serializedObject.FindProperty("m_GamePlayMode");
}
}
}