Fixed rope startup errors
This commit is contained in:
parent
9017315bfe
commit
007e762a47
|
@ -108,12 +108,16 @@ public class RopeSimulator : NetworkBehaviour
|
|||
private void OnEnable()
|
||||
{
|
||||
GameManager.OnPlayersReady += PlayersReady;
|
||||
|
||||
if (NetworkManager.Singleton != null)
|
||||
NetworkManager.Singleton.NetworkTickSystem.Tick += NetworkTick;
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
GameManager.OnPlayersReady -= PlayersReady;
|
||||
|
||||
if (NetworkManager.Singleton != null)
|
||||
NetworkManager.Singleton.NetworkTickSystem.Tick -= NetworkTick;
|
||||
}
|
||||
|
||||
|
@ -384,7 +388,8 @@ public class RopeSimulator : NetworkBehaviour
|
|||
|
||||
private GameState ProcessGame()
|
||||
{
|
||||
GameState localState = new() {
|
||||
GameState localState = new()
|
||||
{
|
||||
tick = currentTick,
|
||||
nrope = Rope.ToNetworkRope(this.rope),
|
||||
enemyPositions = GameObject.FindObjectsByType<EnemyPathFinding>(FindObjectsSortMode.None).Select(e => new Vector3(e.transform.position.x, e.transform.position.y, e.GetComponent<NetworkObject>().NetworkObjectId)).ToArray(),
|
||||
|
|
Loading…
Reference in New Issue