Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
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);
		}
	}
}