mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-23 04:23:04 +00:00
Don't add or destroy VehicleController
This commit is contained in:
parent
f6ddd442e7
commit
f1c3f00574
1 changed files with 3 additions and 3 deletions
|
@ -283,7 +283,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
public VehicleController StartControlling()
|
||||
{
|
||||
//SetAllCarLights();
|
||||
return _controller ?? (_controller = gameObject.AddComponent<VehicleController>());
|
||||
return _controller ?? (_controller = gameObject.GetOrAddComponent<VehicleController>());
|
||||
}
|
||||
|
||||
public void SetAllCarLights()
|
||||
|
@ -341,8 +341,8 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
|
||||
public void StopControlling()
|
||||
{
|
||||
Destroy(_controller);
|
||||
_controller = null;
|
||||
//Destroy(_controller);
|
||||
//_controller = null;
|
||||
}
|
||||
|
||||
private void UpdateColors()
|
||||
|
|
Loading…
Reference in a new issue