mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-25 13:30:17 +00:00
Working on ped networking 3
This commit is contained in:
parent
a5b8e5c51c
commit
3492c39c8b
3 changed files with 12 additions and 2 deletions
|
@ -29,12 +29,16 @@ namespace SanAndreasUnity.Behaviours
|
|||
if (this.isServer)
|
||||
return;
|
||||
|
||||
this.PlayerModel.Load(m_net_pedId);
|
||||
//this.PlayerModel.Load(m_net_pedId);
|
||||
}
|
||||
|
||||
void Update_Net()
|
||||
{
|
||||
m_net_pedId = this.PedDef.Id;
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
destroyer.timeUntilDestroyed = PedManager.Instance.AIOutOfRangeTimeout;
|
||||
destroyer.range = PedManager.Instance.AIOutOfRangeDistance;
|
||||
|
||||
Mirror.NetworkServer.Spawn(go);
|
||||
|
||||
return ped;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue