mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 14:00:17 +00:00
remember time when seat's ped changed
This commit is contained in:
parent
cff2be9531
commit
a68efa0b7d
2 changed files with 5 additions and 0 deletions
|
@ -400,6 +400,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
return;
|
||||
|
||||
m_lastPreparedPeds[index] = ped;
|
||||
seat.TimeWhenPedChanged = Time.time;
|
||||
|
||||
this.OnPedAssignedToVehicle_Radio(ped, seat);
|
||||
|
||||
|
@ -416,6 +417,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
int index = this.Seats.FindIndex(s => s == seat);
|
||||
|
||||
m_lastPreparedPeds[index] = null;
|
||||
seat.TimeWhenPedChanged = Time.time;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -239,6 +239,9 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
/// <summary> Ped that is occupying this seat. </summary>
|
||||
public Ped OccupyingPed { get; internal set; }
|
||||
|
||||
public float TimeWhenPedChanged { get; internal set; } = float.NegativeInfinity;
|
||||
public float TimeSincePedChanged => Time.time - this.TimeWhenPedChanged;
|
||||
|
||||
public bool IsTaken { get { return this.OccupyingPed != null; } }
|
||||
|
||||
public bool IsLeftHand
|
||||
|
|
Loading…
Reference in a new issue