mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 00:37:09 +00:00
Add option to sync vehicle transform using syncvars
This commit is contained in:
parent
63435ad446
commit
9d0f0cfa0d
2 changed files with 7 additions and 2 deletions
|
@ -42,6 +42,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
private void Awake()
|
||||
{
|
||||
//m_vehicle = GetComponent<Vehicle>();
|
||||
this.GetComponent<NetworkTransform>().enabled = ! VehicleManager.Instance.syncVehicleTransformUsingSyncVars;
|
||||
}
|
||||
|
||||
internal void OnAfterCreateVehicle()
|
||||
|
@ -216,6 +217,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
if (NetStatus.IsServer)
|
||||
return;
|
||||
|
||||
if (VehicleManager.Instance.syncVehicleTransformUsingSyncVars)
|
||||
m_vehicle.RigidBody.MovePosition(pos);
|
||||
}
|
||||
|
||||
|
@ -224,6 +226,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
if (NetStatus.IsServer)
|
||||
return;
|
||||
|
||||
if (VehicleManager.Instance.syncVehicleTransformUsingSyncVars)
|
||||
m_vehicle.RigidBody.MoveRotation(rot);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
|
||||
public bool syncPedTransformWhileInVehicle = false;
|
||||
|
||||
public bool syncVehicleTransformUsingSyncVars = false;
|
||||
|
||||
|
||||
void Awake()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue