quantum-space-buddies/QSB/QSBNetworkManager.cs

31 lines
799 B
C#
Raw Normal View History

using UnityEngine;
2020-02-13 19:23:26 +00:00
using UnityEngine.Networking;
2020-02-15 19:48:02 +00:00
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>();
2020-02-13 19:23:26 +00:00
}
2020-02-15 19:48:02 +00:00
public override void OnStartServer()
{
WakeUpSync.IsServer = true;
}
2020-02-15 19:48:02 +00:00
public override void OnClientConnect(NetworkConnection conn)
{
base.OnClientConnect(conn);
2020-02-13 19:23:26 +00:00
DebugLog.Screen("OnClientConnect");
gameObject.AddComponent<WakeUpSync>();
2020-02-13 20:23:12 +00:00
gameObject.AddComponent<SectorSync>();
2020-02-13 19:23:26 +00:00
}
2020-02-15 19:48:02 +00:00
2020-02-13 19:23:26 +00:00
}
}