mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-12-04 01:39:11 +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; } }
|
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()
|
protected override void UpdateHeading()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
||||||
{
|
{
|
||||||
// restore everything
|
// restore everything
|
||||||
|
|
||||||
if (!m_ped.IsInVehicle)
|
this.Cleanup();
|
||||||
{
|
|
||||||
m_ped.characterController.enabled = true;
|
|
||||||
// restore seat's occupying ped ? - no
|
|
||||||
m_ped.transform.SetParent(null, true);
|
|
||||||
m_model.IsInVehicle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_coroutine != null)
|
if (m_coroutine != null)
|
||||||
StopCoroutine(m_coroutine);
|
StopCoroutine(m_coroutine);
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
||||||
|
|
||||||
public override void OnBecameInactive()
|
public override void OnBecameInactive()
|
||||||
{
|
{
|
||||||
|
this.Cleanup();
|
||||||
|
|
||||||
base.OnBecameInactive();
|
base.OnBecameInactive();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue