quantum-space-buddies/QSB/QSBNetworkManager.cs
2020-02-15 20:48:02 +01:00

31 lines
799 B
C#

using UnityEngine;
using UnityEngine.Networking;
namespace QSB
{
public class QSBNetworkManager : NetworkManager
{
private void Awake()
{
var assetBundle = QSB.Helper.Assets.LoadBundle("assets/network");
playerPrefab = assetBundle.LoadAsset<GameObject>("assets/networkplayer.prefab");
playerPrefab.AddComponent<NetworkPlayer>();
}
public override void OnStartServer()
{
WakeUpSync.IsServer = true;
}
public override void OnClientConnect(NetworkConnection conn)
{
base.OnClientConnect(conn);
DebugLog.Screen("OnClientConnect");
gameObject.AddComponent<WakeUpSync>();
gameObject.AddComponent<SectorSync>();
}
}
}