cache petrolcap transform

This commit is contained in:
in0finite 2020-06-29 21:57:44 +02:00
parent ec43361325
commit d6c79434a4

View file

@ -273,6 +273,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
private FrameContainer _frames;
public Transform EngineTransform { get; private set; }
public Transform PetrolcapTransform { get; private set; }
private static GameObject s_highDetailMeshesContainer;
@ -388,6 +389,10 @@ namespace SanAndreasUnity.Behaviours.Vehicles
if (engineFrame != null)
this.EngineTransform = engineFrame.transform;
var petrolcapFrame = _frames.FirstOrDefault(x => x.Name == "petrolcap");
if (petrolcapFrame != null)
this.PetrolcapTransform = petrolcapFrame.transform;
foreach (var frame in _frames)
{
if (!frame.Name.StartsWith("wheel_")) continue;