V3.4.1 整理script位置

This commit is contained in:
2023-10-15 02:16:43 +09:00
parent eabbb656cb
commit 86d6b41ed7
77 changed files with 43272 additions and 302 deletions
@@ -0,0 +1,36 @@
using Unity.MLAgents;
using Unity.MLAgents.SideChannels;
using UnityEngine;
public class AimBotSideChannelController : 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);
}
}
public void SendSideChannelMessage(string MessageType, string message)
{
Debug.LogWarning(MessageType + "|" + message);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9585e6d628809d14ba93cb74005c3514
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,39 @@
using System;
using Unity.MLAgents.SideChannels;
using UnityEngine;
public class AimbotSideChannel : SideChannel
{
public AimbotSideChannel()
{
ChannelId = new Guid("8bbfb62a-99b4-457c-879d-b78b69066b5e");
}
protected override void OnMessageReceived(IncomingMessage msg)
{
var receivedString = msg.ReadString();
Debug.Log("From Python : " + receivedString);
}
public void SendDebugStatementToPython(string logString, string stackTrace, LogType type)
{
if (type == LogType.Warning)
{
var stringToSend = "Warning|" + logString;
using (var msgOut = new OutgoingMessage())
{
msgOut.WriteString(stringToSend);
QueueMessageToSend(msgOut);
}
}
if (type == LogType.Error)
{
var stringToSend = "Error|" + logString;
using (var msgOut = new OutgoingMessage())
{
msgOut.WriteString(stringToSend);
QueueMessageToSend(msgOut);
}
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6836d727b536dd54e893311318779b9a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: