mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 04:23:04 +00:00
Working on vehicle sync 5
This commit is contained in:
parent
63491e76ea
commit
2842d653ef
3 changed files with 13 additions and 8 deletions
|
@ -14,6 +14,17 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
public Vehicle.SeatAlignment CurrentVehicleSeatAlignment { get { return this.CurrentVehicleSeat.Alignment; } }
|
||||
|
||||
|
||||
protected void Cleanup()
|
||||
{
|
||||
if (!m_ped.IsInVehicle)
|
||||
{
|
||||
m_ped.characterController.enabled = true;
|
||||
// restore seat's occupying ped ? - no
|
||||
m_ped.transform.SetParent(null, true);
|
||||
m_model.IsInVehicle = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateHeading()
|
||||
{
|
||||
|
||||
|
|
|
@ -17,13 +17,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
{
|
||||
// restore everything
|
||||
|
||||
if (!m_ped.IsInVehicle)
|
||||
{
|
||||
m_ped.characterController.enabled = true;
|
||||
// restore seat's occupying ped ? - no
|
||||
m_ped.transform.SetParent(null, true);
|
||||
m_model.IsInVehicle = false;
|
||||
}
|
||||
this.Cleanup();
|
||||
|
||||
if (m_coroutine != null)
|
||||
StopCoroutine(m_coroutine);
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
|||
|
||||
public override void OnBecameInactive()
|
||||
{
|
||||
|
||||
this.Cleanup();
|
||||
|
||||
base.OnBecameInactive();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue