using QSB.Animation; using QSB.TransformSync; using UnityEngine; using UnityEngine.Networking; namespace QSB { public class QSBNetworkManager : NetworkManager { private AssetBundle _assetBundle; private GameObject _shipPrefab; private void Awake() { _assetBundle = QSB.Helper.Assets.LoadBundle("assets/network"); playerPrefab = _assetBundle.LoadAsset("assets/networkplayer.prefab"); playerPrefab.AddComponent(); playerPrefab.AddComponent(); _shipPrefab = _assetBundle.LoadAsset("assets/networkship.prefab"); _shipPrefab.AddComponent(); spawnPrefabs.Add(_shipPrefab); } public override void OnServerAddPlayer(NetworkConnection conn, short playerControllerId) { base.OnServerAddPlayer(conn, playerControllerId); NetworkServer.SpawnWithClientAuthority(Instantiate(_shipPrefab), conn); } public override void OnStartServer() { WakeUpSync.IsServer = true; } public override void OnClientConnect(NetworkConnection conn) { base.OnClientConnect(conn); DebugLog.Screen("OnClientConnect"); gameObject.AddComponent(); gameObject.AddComponent(); } } }