Rename var

This commit is contained in:
in0finite 2019-04-29 20:28:10 +02:00
parent 531da482ff
commit 7360e6f0ca
2 changed files with 5 additions and 5 deletions

View file

@ -276,7 +276,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
public Transform DriverTransform { get; private set; }
public bool HasDriver { get { return DriverTransform != null && DriverTransform.childCount > 0; } }
public bool HasDriverSeat { get { return DriverTransform != null && DriverTransform.childCount > 0; } }
public bool IsControlling { get { return _controller != null; } }
@ -368,7 +368,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
float horAxis = Input.GetAxis("Horizontal");
// Set car lights
if (HasDriver)
if (HasDriverSeat)
{
if (horAxis != 0)
blinkerMode = horAxis < 0 ? VehicleBlinkerMode.Left : VehicleBlinkerMode.Right;
@ -404,7 +404,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
wheel.Child.localRotation = Quaternion.AngleAxis(wheel.Collider.steerAngle, Vector3.up) * wheel.Roll;
}
if (HasDriver)
if (HasDriverSeat)
{
if(Input.GetKeyDown(KeyCode.F))
{

View file

@ -101,7 +101,7 @@ public class VehicleBlinker : MonoBehaviour
private void Update()
{
// Must review
if (vehicle.HasDriver && !ShouldBePowered && blinkerSwitch)
if (vehicle.HasDriverSeat && !ShouldBePowered && blinkerSwitch)
{
//Debug.Log("Turning off blinkers!");
blinkerSwitch = false;
@ -110,7 +110,7 @@ public class VehicleBlinker : MonoBehaviour
private void Cycle()
{
if (!(vehicle.HasDriver && ShouldBePowered))
if (!(vehicle.HasDriverSeat && ShouldBePowered))
return;
blinkerSwitch = !blinkerSwitch;