using Unity.MLAgents; using Unity.MLAgents.SideChannels; using UnityEngine; public class AimBotSideChennelController : MonoBehaviour { public AimbotSideChannel aimbotSideChannel; public void Awake() { // We create the Side Channel aimbotSideChannel = new AimbotSideChannel(); // When a Debug.Log message is created, we send it to the stringChannel Application.logMessageReceived += aimbotSideChannel.SendDebugStatementToPython; // The channel must be registered with the SideChannelManager class SideChannelManager.RegisterSideChannel(aimbotSideChannel); } // Side Channel public void OnDestroy() { // De-register the Debug.Log callback Application.logMessageReceived -= aimbotSideChannel.SendDebugStatementToPython; if (Academy.IsInitialized) { SideChannelManager.UnregisterSideChannel(aimbotSideChannel); } } }