Files
real-shooter/Assets/Scripts/Statistics/Logger.cs
2022-05-17 19:09:50 +07:00

29 lines
733 B
C#

using System;
using Unity.MLAgents.SideChannels;
using UnityEngine;
namespace Statistics
{
public class LoggerSideChannel : SideChannel
{
public LoggerSideChannel()
{
ChannelId = new Guid("621f0a70-4f87-11ea-a6bf-784f4387d1f7");
}
public void SendLog(Log log)
{
using (var logOut = new OutgoingMessage())
{
logOut.WriteString(JsonUtility.ToJson(log));
QueueMessageToSend(logOut);
}
}
protected override void OnMessageReceived(IncomingMessage msg)
{
var receivedString = msg.ReadString();
Debug.Log("From Python : " + receivedString);
}
}
}