Implement RPC Node
This commit is contained in:
parent
f7ee533d5a
commit
605e43273e
13 changed files with 524 additions and 206 deletions
|
|
@ -16,17 +16,7 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
|
|||
|
||||
if (IsMainPlayer())
|
||||
{
|
||||
GameManager.Singleton.ApplyOrigin();
|
||||
|
||||
if (!Global.IsGameHost)
|
||||
{
|
||||
GameManager.Singleton.RpcId(
|
||||
1,
|
||||
nameof(GameManager.Singleton.RpcSendNearbySectors),
|
||||
CurrentSector.Coordinates,
|
||||
NetworkManager.Singleton.LocalNetId
|
||||
);
|
||||
}
|
||||
GameManager.Instance.ApplyOrigin();
|
||||
}
|
||||
|
||||
reassigning = false;
|
||||
|
|
@ -34,7 +24,7 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
|
|||
|
||||
public bool IsMainPlayer()
|
||||
{
|
||||
return player == GameManager.Singleton.MainPlayer;
|
||||
return player == GameManager.Instance.MainPlayer;
|
||||
}
|
||||
|
||||
public Player InstantiatePlayer()
|
||||
|
|
@ -48,6 +38,14 @@ public class Character(Sector sector, Vector3 localCoordinates) : GameObject(sec
|
|||
return instance;
|
||||
}
|
||||
|
||||
public override void Simulate(double delta)
|
||||
{
|
||||
if (!reassigning && !IsInCurrentSector())
|
||||
{
|
||||
UpdateSector();
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateNodePosition()
|
||||
{
|
||||
if (IsMainPlayer())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue