mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-14 16:27:19 +00:00
log error if frame is not child of vehicle
This commit is contained in:
parent
96b0ac1f33
commit
9c63b25d38
1 changed files with 12 additions and 1 deletions
|
@ -213,9 +213,20 @@ namespace SanAndreasUnity.Behaviours.Vehicles
|
|||
{
|
||||
Frame frame = this.Frames.FirstOrDefault(f => f.gameObject.name == frameName);
|
||||
if (null == frame)
|
||||
{
|
||||
Debug.LogError($"Failed to find frame by name: {frameName}");
|
||||
}
|
||||
else
|
||||
DetachFrameDuringExplosion(frame, mass, parentGo);
|
||||
{
|
||||
if (this.transform.IsParentOf(frame.transform))
|
||||
{
|
||||
DetachFrameDuringExplosion(frame, mass, parentGo);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"Can not detach frame ({frameName}) from vehicle {this.DescriptionForLogging} because it seems that the frame is already detached");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DetachFrameDuringExplosion(Frame frame, float mass, GameObject parentGo)
|
||||
|
|
Loading…
Reference in a new issue