Add some vehicle settings to Options

This commit is contained in:
in0finite 2019-05-06 01:45:33 +02:00
parent ce2631ca99
commit d4f25102e2
2 changed files with 24 additions and 3 deletions

View file

@ -5,6 +5,7 @@ using SanAndreasUnity.UI;
using SanAndreasUnity.Utilities;
using SanAndreasUnity.Behaviours;
using SanAndreasUnity.Behaviours.Weapons;
using SanAndreasUnity.Behaviours.Vehicles;
namespace SanAndreasUnity.Settings {
@ -43,12 +44,32 @@ namespace SanAndreasUnity.Settings {
persistType = OptionsWindow.InputPersistType.OnStart
};
OptionsWindow.BoolInput m_syncVehiclesLinearVelocity = new OptionsWindow.BoolInput ("Sync vehicle's linear velocity") {
isAvailable = () => VehicleManager.Instance != null,
getValue = () => VehicleManager.Instance.syncLinearVelocity,
setValue = (value) => { VehicleManager.Instance.syncLinearVelocity = value; },
persistType = OptionsWindow.InputPersistType.OnStart
};
OptionsWindow.BoolInput m_syncVehiclesAngularVelocity = new OptionsWindow.BoolInput ("Sync vehicle's angular velocity") {
isAvailable = () => VehicleManager.Instance != null,
getValue = () => VehicleManager.Instance.syncAngularVelocity,
setValue = (value) => { VehicleManager.Instance.syncAngularVelocity = value; },
persistType = OptionsWindow.InputPersistType.OnStart
};
OptionsWindow.BoolInput m_disableVehiclesRigidBodyOnClients = new OptionsWindow.BoolInput ("Disable vehicle's rigid body on clients") {
isAvailable = () => VehicleManager.Instance != null,
getValue = () => VehicleManager.Instance.disableRigidBodyOnClients,
setValue = (value) => { VehicleManager.Instance.disableRigidBodyOnClients = value; },
persistType = OptionsWindow.InputPersistType.OnStart
};
void Awake ()
{
var inputs = new OptionsWindow.Input[] { m_timeScaleInput, m_gravityInput, m_displayHealthBarsInput, m_displayMinimapInput,
m_runInBackgroundInput, m_drawLineFromGunInput
m_runInBackgroundInput, m_drawLineFromGunInput,
m_syncVehiclesLinearVelocity, m_syncVehiclesAngularVelocity, m_disableVehiclesRigidBodyOnClients,
};
foreach (var input in inputs)

View file

@ -14,9 +14,9 @@
- When ped enters vehicle, he changes parent. Is this allowed in Mirror ? Possible solution would be to only change parent of ped model.
- while ped is in vehicle, network transform should not sync
- **while ped is in vehicle, network transform should not sync**
- vehicle is bumping on clients - disable (or destroy) wheel colliders, and sync them - this should not be done on local player, see below
- **vehicle is bumping on clients** - disable (or destroy) wheel colliders, and sync them - this should not be done on local player, see below
- when exit vehicle anim is finished on client, it is repeated - change wrap mode