Working on ped networking 3

This commit is contained in:
in0finite 2019-04-24 15:54:17 +02:00
parent a5b8e5c51c
commit 3492c39c8b
3 changed files with 12 additions and 2 deletions

View file

@ -29,11 +29,15 @@ namespace SanAndreasUnity.Behaviours
if (this.isServer)
return;
this.PlayerModel.Load(m_net_pedId);
//this.PlayerModel.Load(m_net_pedId);
}
void Update_Net()
{
if (!this.isServer)
return;
if (this.PedDef != null)
m_net_pedId = this.PedDef.Id;
m_net_state = this.CurrentState != null ? this.CurrentState.GetType().Name : "";
//m_net_weapon = this.CurrentWeapon;
@ -44,6 +48,8 @@ namespace SanAndreasUnity.Behaviours
if (this.isServer)
return;
Debug.LogFormat("ped id changed to {0}", newId);
this.PlayerModel.Load(newId);
}

View file

@ -34,6 +34,8 @@ namespace SanAndreasUnity.Behaviours
destroyer.timeUntilDestroyed = PedManager.Instance.AIOutOfRangeTimeout;
destroyer.range = PedManager.Instance.AIOutOfRangeDistance;
Mirror.NetworkServer.Spawn(go);
return ped;
}

View file

@ -12,6 +12,8 @@
- add OK button to message boxes
- player's ped must be created by server (when host starts) - it should be removed from scenes
# Potential problems