mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 12:33:02 +00:00
Remove some code
This commit is contained in:
parent
be2e685257
commit
8b75f2c3e2
1 changed files with 1 additions and 26 deletions
|
@ -286,8 +286,6 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
||||||
|
|
||||||
public bool HasDriverSeat { get { return DriverTransform != null && DriverTransform.childCount > 0; } }
|
public bool HasDriverSeat { get { return DriverTransform != null && DriverTransform.childCount > 0; } }
|
||||||
|
|
||||||
public bool IsControlling { get { return _controller != null; } }
|
|
||||||
|
|
||||||
public VehicleController StartControlling()
|
public VehicleController StartControlling()
|
||||||
{
|
{
|
||||||
//SetAllCarLights();
|
//SetAllCarLights();
|
||||||
|
@ -373,16 +371,6 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
float horAxis = Input.GetAxis("Horizontal");
|
|
||||||
|
|
||||||
// Set car lights
|
|
||||||
if (HasDriverSeat)
|
|
||||||
{
|
|
||||||
if (horAxis != 0)
|
|
||||||
blinkerMode = horAxis < 0 ? VehicleBlinkerMode.Left : VehicleBlinkerMode.Right;
|
|
||||||
else if (horAxis == 0 && Steering == 0 && blinkerMode != VehicleBlinkerMode.None)
|
|
||||||
StartCoroutine(DelayedBlinkersTurnOff());
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var wheel in _wheels)
|
foreach (var wheel in _wheels)
|
||||||
{
|
{
|
||||||
|
@ -412,24 +400,11 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
||||||
wheel.Child.localRotation = Quaternion.AngleAxis(wheel.Collider.steerAngle, Vector3.up) * wheel.Roll;
|
wheel.Child.localRotation = Quaternion.AngleAxis(wheel.Collider.steerAngle, Vector3.up) * wheel.Roll;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasDriverSeat)
|
|
||||||
{
|
|
||||||
if (Braking > 0.125f)
|
|
||||||
SetLight(VehicleLight.Rear, 1f);
|
|
||||||
else
|
|
||||||
SetLight(VehicleLight.Rear, 0f);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (IsAnyLightPowered())
|
|
||||||
SetLight(VehicleLight.All, 0f);
|
|
||||||
Braking = 1f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_colorsChanged)
|
if (_colorsChanged)
|
||||||
{
|
{
|
||||||
UpdateColors();
|
UpdateColors();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FixedUpdate()
|
private void FixedUpdate()
|
||||||
|
|
Loading…
Reference in a new issue