32 lines
833 B
C#
32 lines
833 B
C#
using AlicizaX.Runtime;
|
|
using Cysharp.Threading.Tasks;
|
|
using Fantasy.Network;
|
|
using Fantasy.Network.Interface;
|
|
using UnityEngine;
|
|
using UnityEngine.Scripting;
|
|
|
|
namespace AlicizaX.Network.Runtime
|
|
{
|
|
[DisallowMultipleComponent]
|
|
[AddComponentMenu("Game Framework/Network")]
|
|
[Preserve]
|
|
public sealed class NetworkComponent : MonoBehaviour
|
|
{
|
|
private INetworkModule _networkModule;
|
|
|
|
[SerializeField] private int m_HeartInterval = 2000;
|
|
|
|
private void Awake()
|
|
{
|
|
_networkModule = ModuleSystem.RegisterModule<INetworkModule>(typeof(NetworkModule));
|
|
if (_networkModule == null)
|
|
{
|
|
Log.Fatal("Network Manager is invalid.");
|
|
return;
|
|
}
|
|
|
|
_networkModule.SetHeartInterval(m_HeartInterval);
|
|
}
|
|
}
|
|
}
|