Aimbot-ParallelEnv/Assets/Script/InGame/AimBotSideChennelController.cs
Koha9 64ada808de V2.6 change Ray Tag result as Onehot
change Ray Tag result as Onehot, 
Observation State:
-targetStates 6
-inTargetArea 1
-remainTime 1
-gunReady 1
-my Obs 4
-tag onehot 19*2
-tag dis 19
2022-12-10 10:14:44 +09:00

35 lines
1011 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.SideChannels;
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);
}
}
}