Rename var

This commit is contained in:
in0finite 2019-04-30 00:11:14 +02:00
parent 78507f0f32
commit ad2c8c9010
2 changed files with 11 additions and 11 deletions

View file

@ -6,18 +6,18 @@ namespace SanAndreasUnity.Behaviours.Vehicles
[RequireComponent(typeof(Vehicle))]
public class VehicleController : MonoBehaviour
{
private Vehicle _vehicle;
private Vehicle m_vehicle;
private void Awake()
{
_vehicle = GetComponent<Vehicle>();
m_vehicle = GetComponent<Vehicle>();
}
private void Update()
{
var driverSeat = _vehicle.DriverSeat;
var driverSeat = m_vehicle.DriverSeat;
if (null == driverSeat || null == driverSeat.OccupyingPed)
{
@ -37,7 +37,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
var accel = Input.GetAxis("Vertical");
var brake = Input.GetButton("Brake") ? 1.0f : 0.0f;
var speed = Vector3.Dot(_vehicle.Velocity, _vehicle.transform.forward);
var speed = Vector3.Dot(m_vehicle.Velocity, m_vehicle.transform.forward);
if (speed * accel < 0f)
{
@ -45,16 +45,16 @@ namespace SanAndreasUnity.Behaviours.Vehicles
accel = 0f;
}
_vehicle.Accelerator = accel;
_vehicle.Steering = Input.GetAxis("Horizontal");
_vehicle.Braking = brake;
m_vehicle.Accelerator = accel;
m_vehicle.Steering = Input.GetAxis("Horizontal");
m_vehicle.Braking = brake;
}
void ResetInput()
{
_vehicle.Accelerator = 0;
_vehicle.Steering = 0;
_vehicle.Braking = 0;
m_vehicle.Accelerator = 0;
m_vehicle.Steering = 0;
m_vehicle.Braking = 0;
}
}
}

View file

@ -8,7 +8,7 @@
- adapt states:
- send button input events to server: submit,
- send button input events to server:
- When ped enters vehicle, he changes parent. Is this allowed in Mirror ? Possible solution would be to only change parent of ped model.