mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-17 05:18:27 +00:00
Working on vehicle exiting
This commit is contained in:
parent
6ae76e392f
commit
be83e941a7
1 changed files with 7 additions and 13 deletions
|
@ -34,7 +34,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
// obtain current vehicle from Ped
|
||||
this.CurrentVehicle = m_ped.CurrentVehicle;
|
||||
this.CurrentVehicleSeat = m_ped.CurrentVehicleSeat;
|
||||
|
||||
|
||||
m_isExitingImmediately = immediate;
|
||||
|
||||
// after obtaining parameters, switch to this state
|
||||
|
@ -89,23 +89,17 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
// ped now completely exited the vehicle
|
||||
|
||||
m_model.IsInVehicle = false;
|
||||
|
||||
this.CurrentVehicle = null;
|
||||
this.CurrentVehicleSeat = null;
|
||||
seat.OccupyingPed = null;
|
||||
|
||||
m_ped.transform.localPosition = m_model.VehicleParentOffset;
|
||||
m_ped.transform.localRotation = Quaternion.identity;
|
||||
|
||||
m_ped.transform.SetParent(null);
|
||||
|
||||
m_ped.characterController.enabled = true;
|
||||
|
||||
m_model.VehicleParentOffset = Vector3.zero;
|
||||
|
||||
// switch to stand state
|
||||
m_ped.SwitchState<StandState> ();
|
||||
|
||||
// now switch to other state
|
||||
// when our state gets deactivated, it will cleanup everything
|
||||
|
||||
if (m_isServer)
|
||||
m_ped.SwitchState<StandState> ();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue