File size: 1,102 Bytes
00437a9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
using System;

namespace Quantum
{
	/// <summary>
	/// Using this system is optional. It is only used to aim the Debugger on the Unity side.
	/// It is also safe to copy logic from this system into your own systems, if it better suits your architecture.
	/// </summary>
	public class BotSDKDebuggerSystem : SystemMainThread
	{
		// Used for DEBUGGING purposes only
		public static Action<Frame> OnVerifiedFrame;
		public static Action<EntityRef, string> SetEntityDebugLabel;

		/// <summary>
		/// Use this to add an entity to the Debugger Window on Unity.
		/// You can provide a custom label of your preference if you want to identify your bots in a custom way.
		/// Use the separator '/' on the custom label if you want to create an Hierarchy on the Debugger Window.
		/// </summary>
		public static void AddToDebugger(EntityRef entity, string customLabel = default)
		{
			if (SetEntityDebugLabel != null)
			{
				SetEntityDebugLabel(entity, customLabel);
			}
		}

		public override void Update(Frame frame)
		{
			if (frame.IsVerified)
			{
				OnVerifiedFrame?.Invoke(frame);
			}
		}
	}
}