mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-16 21:08:28 +00:00
sync health
This commit is contained in:
parent
e5ef9e03c7
commit
eb7c90f0ab
2 changed files with 7 additions and 2 deletions
|
@ -34,6 +34,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
[SyncVar] Vector3 m_net_movementInput;
|
[SyncVar] Vector3 m_net_movementInput;
|
||||||
[SyncVar] Vector3 m_net_heading;
|
[SyncVar] Vector3 m_net_heading;
|
||||||
|
|
||||||
|
[SyncVar] float m_net_health;
|
||||||
|
|
||||||
//[SyncVar(hook=nameof(Net_OnWeaponChanged))] GameObject m_net_weaponGameObject;
|
//[SyncVar(hook=nameof(Net_OnWeaponChanged))] GameObject m_net_weaponGameObject;
|
||||||
[SyncVar(hook=nameof(Net_OnWeaponChanged))] int m_net_currentWeaponSlot;
|
[SyncVar(hook=nameof(Net_OnWeaponChanged))] int m_net_currentWeaponSlot;
|
||||||
|
|
||||||
|
@ -117,6 +119,9 @@ namespace SanAndreasUnity.Behaviours
|
||||||
if (m_net_heading != this.Heading)
|
if (m_net_heading != this.Heading)
|
||||||
m_net_heading = this.Heading;
|
m_net_heading = this.Heading;
|
||||||
|
|
||||||
|
if (m_net_health != this.Health)
|
||||||
|
m_net_health = this.Health;
|
||||||
|
|
||||||
if (this.WeaponHolder.CurrentWeaponSlot != m_net_currentWeaponSlot)
|
if (this.WeaponHolder.CurrentWeaponSlot != m_net_currentWeaponSlot)
|
||||||
{
|
{
|
||||||
m_net_currentWeaponSlot = this.WeaponHolder.CurrentWeaponSlot;
|
m_net_currentWeaponSlot = this.WeaponHolder.CurrentWeaponSlot;
|
||||||
|
@ -133,6 +138,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
this.Heading = m_net_heading;
|
this.Heading = m_net_heading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.Health = m_net_health;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// send input to server
|
// send input to server
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
- add option to remove current weapon - for testing
|
- add option to remove current weapon - for testing
|
||||||
|
|
||||||
- sync fire event
|
|
||||||
|
|
||||||
- sync health
|
- sync health
|
||||||
|
|
||||||
- gun flash doesn't work on client ?
|
- gun flash doesn't work on client ?
|
||||||
|
|
Loading…
Add table
Reference in a new issue