quantum-space-buddies/QSB/QSBNetworkManager.cs
amazingalek e9a427f44d
Synchronize player animations
* just formatting

* * moved message stuff to new project
* generated .gitignore from https://gitignore.io/api/unity,visualstudio

* fixed build event for message project

* wip

* .

* .

* :S:S:S

* fixed working dir thing

* fixed gitignore

* adding .csproj.user

* .

* nothing works

* fixed gitignore for UnityProject

* wonky animation! \o/

* fixed csproj

* merge

* keeping this line solves the issue of animating local clones

* removed trigger case
2020-02-18 11:08:08 +01:00

34 lines
936 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>();
var anim = playerPrefab.AddComponent<Animator>();
playerPrefab.AddComponent<NetworkAnimator>().animator = anim;
}
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>();
}
}
}