quantum-space-buddies/QSB/QSBNetworkManager.cs
amazingalek 0e9bfdd9ae
Alek/smooth anim (#19)
* cleanup of animation sync
* smooth animations
2020-02-18 21:39:18 +01:00

32 lines
855 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>();
playerPrefab.AddComponent<AnimationSync>();
}
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>();
}
}
}