summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/NGS.MeshFusionPro/DynamicCombinedObjectPart.cs
blob: c2ff95d5045fc3255c056c62d7404b376c11d160 (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
36
37
38
39
40
41
42
43
44
using UnityEngine;

namespace NGS.MeshFusionPro;

public abstract class DynamicCombinedObjectPart : ICombinedObjectPart<DynamicCombinedObject>, ICombinedObjectPart
{
	protected DynamicCombinedObject _root;

	protected CombinedObjectPart _basePart;

	private bool _destroyed;

	ICombinedObject ICombinedObjectPart.Root => Root;

	public DynamicCombinedObject Root => _root;

	public Bounds LocalBounds => _basePart.LocalBounds;

	public Bounds Bounds => _basePart.Bounds;

	public DynamicCombinedObjectPart(DynamicCombinedObject root, CombinedObjectPart basePart, Matrix4x4 transformMatrix)
	{
		_root = root;
		_basePart = basePart;
	}

	public abstract void Move(Vector3 position, Quaternion rotation, Vector3 scale);

	public abstract void Move(Matrix4x4 transform);

	public abstract void MoveLocal(Matrix4x4 localTransform);

	public void Destroy()
	{
		if (_destroyed)
		{
			Debug.Log("Part already destroyed");
		}
		else
		{
			_root.Destroy(this, _basePart);
		}
	}
}