summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/NGS.MeshFusionPro/BinaryTreeDrawer.cs
blob: 87776a29889efab1743bea59e1c5dba58ec5ca3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using UnityEngine;

namespace NGS.MeshFusionPro;

public class BinaryTreeDrawer<TData>
{
	public void DrawGizmo(IBinaryTreeNode root, Color color)
	{
		Gizmos.color = color;
		DrawNode(root);
	}

	private void DrawNode(IBinaryTreeNode node)
	{
		Gizmos.DrawWireCube(node.Center, node.Size);
		if (node.HasChilds)
		{
			DrawNode(node.GetLeft());
			DrawNode(node.GetRight());
		}
	}
}