41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
|
|
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");
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|