com.alicizax.unity.network/Editor/NetworkComponentInspector.cs
2025-03-20 20:47:48 +08:00

35 lines
1017 B
C#

using System;
using AlicizaX.Editor;
using AlicizaX.Network.Runtime;
using UnityEditor;
namespace AlicizaX.Network.Editor
{
[CustomEditor(typeof(NetworkComponent))]
internal sealed class NetworkComponentInspector : GameFrameworkInspector
{
private SerializedProperty m_HeartInterval = null;
private void OnEnable()
{
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();
}
}
}