mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-29 07:20:19 +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,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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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