summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/NGS.MeshFusionPro/CombinedObjectPart.cs
blob: ca434ffdfcb5391bf42b2f89ce4e5ff49d4c599f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using UnityEngine;

namespace NGS.MeshFusionPro;

public class CombinedObjectPart : ICombinedObjectPart<CombinedObject>, ICombinedObjectPart
{
	private bool _destroyed;

	ICombinedObject ICombinedObjectPart.Root => Root;

	public CombinedObject Root { get; private set; }

	public CombinedMeshPart MeshPart { get; private set; }

	public Bounds LocalBounds => Root.GetLocalBounds(this);

	public Bounds Bounds => Root.GetBounds(this);

	public CombinedObjectPart(CombinedObject root, CombinedMeshPart meshPart)
	{
		Root = root;
		MeshPart = meshPart;
	}

	public void Destroy()
	{
		if (_destroyed)
		{
			Debug.Log("CombinedPart already destroyed");
			return;
		}
		Root.Destroy(this);
		_destroyed = true;
	}
}