Repository URL to install this package:
Version:
1.1.0 ▾
|
using System.Collections.Generic;
using System.Globalization;
using Fluctio.FluctioSim.Common.Configuration;
using Fluctio.FluctioSim.Core.Components.MachineLearning.NumberProviders;
using MoreLinq;
using UnityEngine;
namespace Fluctio.FluctioSim.Core.Components.MachineLearning.TriggerActions
{
[AddComponentMenu(Config.PrefixedName+"/Machine Learning/Trigger Actions/Log Info", Config.ComponentMenuOrder + 100)]
public class LogInfoAction : TriggerAction
{
[SerializeField] protected LogType logType = LogType.Log;
[SerializeField] protected string label = "";
[SerializeField] protected NumberProvider number = null;
private string Message
{
get {
var messages = new List<string>();
if (label != "")
{
messages.Add(label);
}
if (number != null)
{
messages.Add(number.GetNumber().ToString(CultureInfo.CurrentCulture));
}
return messages.ToDelimitedString(" | ");
}
}
public override void OnExecute()
{
Debug.unityLogger.Log(logType, Message);
}
}
}