2020-02-14 22:14:24 +01:00
|
|
|
|
using UnityEngine;
|
2020-02-13 20:23:26 +01:00
|
|
|
|
using UnityEngine.Networking;
|
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
namespace QSB
|
|
|
|
|
{
|
|
|
|
|
public class QSBNetworkManager : NetworkManager
|
|
|
|
|
{
|
|
|
|
|
private void Awake()
|
|
|
|
|
{
|
2020-02-13 20:34:51 +01:00
|
|
|
|
var assetBundle = QSB.Helper.Assets.LoadBundle("assets/network");
|
|
|
|
|
playerPrefab = assetBundle.LoadAsset<GameObject>("assets/networkplayer.prefab");
|
|
|
|
|
playerPrefab.AddComponent<NetworkPlayer>();
|
2020-02-18 11:08:08 +01:00
|
|
|
|
|
|
|
|
|
var anim = playerPrefab.AddComponent<Animator>();
|
|
|
|
|
playerPrefab.AddComponent<NetworkAnimator>().animator = anim;
|
2020-02-13 20:23:26 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
public override void OnStartServer()
|
|
|
|
|
{
|
|
|
|
|
WakeUpSync.IsServer = true;
|
2020-02-14 22:14:24 +01:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-15 20:48:02 +01:00
|
|
|
|
public override void OnClientConnect(NetworkConnection conn)
|
|
|
|
|
{
|
2020-02-14 22:14:24 +01:00
|
|
|
|
base.OnClientConnect(conn);
|
2020-02-13 20:23:26 +01:00
|
|
|
|
|
2020-02-14 22:14:24 +01:00
|
|
|
|
DebugLog.Screen("OnClientConnect");
|
|
|
|
|
gameObject.AddComponent<WakeUpSync>();
|
2020-02-13 21:23:12 +01:00
|
|
|
|
gameObject.AddComponent<SectorSync>();
|
2020-02-13 20:23:26 +01:00
|
|
|
|
}
|
2020-02-15 20:48:02 +01:00
|
|
|
|
|
2020-02-13 20:23:26 +01:00
|
|
|
|
}
|
|
|
|
|
}
|