mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 04:23:04 +00:00
Converting vehicle states to new API 3
This commit is contained in:
parent
b474d7df85
commit
ec4435e181
1 changed files with 12 additions and 8 deletions
|
@ -11,6 +11,12 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
{
|
||||
|
||||
|
||||
public override void OnBecameActive()
|
||||
{
|
||||
base.OnBecameActive();
|
||||
this.EnterVehicleInternal();
|
||||
}
|
||||
|
||||
public override void OnBecameInactive()
|
||||
{
|
||||
this.Cleanup();
|
||||
|
@ -25,11 +31,16 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
public void EnterVehicle(Vehicle vehicle, Vehicle.Seat seat)
|
||||
{
|
||||
|
||||
this.CurrentVehicle = vehicle;
|
||||
this.CurrentVehicleSeat = seat;
|
||||
|
||||
m_ped.SwitchState<VehicleSittingState> ();
|
||||
}
|
||||
|
||||
void EnterVehicleInternal()
|
||||
{
|
||||
Vehicle vehicle = this.CurrentVehicle;
|
||||
Vehicle.Seat seat = this.CurrentVehicleSeat;
|
||||
|
||||
VehicleEnteringState.PreparePedForVehicle(m_ped, vehicle, seat);
|
||||
|
||||
|
@ -42,13 +53,6 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
m_model.PlayAnim(AnimGroup.Car, AnimIndex.SitPassenger, PlayMode.StopAll);
|
||||
}
|
||||
|
||||
// send message to clients
|
||||
if (m_isServer)
|
||||
{
|
||||
foreach(var pedSync in Net.Player.AllPlayers.Select(p => p.GetComponent<Net.PedSync>()))
|
||||
pedSync.PedEnteredVehicle(m_ped);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue