using AlicizaX.Editor; using AlicizaX.Network.Runtime; using UnityEditor; namespace AlicizaX.Network.Editor { [CustomEditor(typeof(NetworkComponent))] internal sealed class NetworkComponentInspector : ComponentTypeComponentInspector { private SerializedProperty m_HeartInterval = null; protected override void Enable() { base.Enable(); m_HeartInterval = serializedObject.FindProperty("m_HeartInterval"); } public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode); { int heartInterval = EditorGUILayout.IntField("心跳间隔时间/ms", m_HeartInterval.intValue); if (heartInterval != m_HeartInterval.intValue) { m_HeartInterval.intValue = heartInterval; } } EditorGUI.EndDisabledGroup(); Repaint(); } protected override void RefreshTypeNames() { RefreshComponentTypeNames(typeof(INetworkManager)); } } }