mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-18 13:58:28 +00:00
using appropriate input buttons based on whether the ped is driving vehicle or not
This commit is contained in:
parent
f85a7d813b
commit
b1fc9c8d8c
2 changed files with 26 additions and 3 deletions
Assets/Scripts
|
@ -40,7 +40,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
|
||||
public bool IsInVehicleSeat { get { return this.CurrentState != null && this.CurrentState.RepresentsState (typeof(VehicleSittingState)); } }
|
||||
|
||||
public bool IsDrivingVehicle { get { return this.CurrentVehicleSeat != null && this.CurrentVehicleSeat.IsDriver; } }
|
||||
public bool IsDrivingVehicle { get { var seat = this.CurrentVehicleSeat; return seat != null && seat.IsDriver; } }
|
||||
|
||||
public Vehicle.SeatAlignment CurrentVehicleSeatAlignment { get { return this.CurrentVehicleSeat.Alignment; } }
|
||||
|
||||
|
|
|
@ -119,9 +119,32 @@ namespace SanAndreasUnity.UI
|
|||
CustomInput.Instance.SetButtonDown("LeftClick", false);
|
||||
CustomInput.Instance.SetButtonDown("RightClick", false);
|
||||
|
||||
this.UpdatePedMovementInput();
|
||||
this.UpdateActionsInput();
|
||||
Ped ped = Ped.Instance;
|
||||
|
||||
if (ped != null)
|
||||
{
|
||||
if (ped.IsDrivingVehicle)
|
||||
{
|
||||
pedMovementInputGo.SetActive(false);
|
||||
vehicleInputGo.SetActive(true);
|
||||
|
||||
this.UpdateVehicleTurningInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
pedMovementInputGo.SetActive(true);
|
||||
vehicleInputGo.SetActive(false);
|
||||
|
||||
this.UpdatePedMovementInput();
|
||||
}
|
||||
|
||||
this.UpdateActionsInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
pedMovementInputGo.SetActive(false);
|
||||
vehicleInputGo.SetActive(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue