public static int Visualize(this int value, string name, Component owner, Visualizsation viz = Visualizsation.PlainValue) { #if UNITY_EDITOR return((int)InternalVisualize(viz, owner, name, value)); #else return(value); #endif }
private static float InternalVisualize(Visualizsation viz, Component owner, string name, float value) { #if UNITY_EDITOR var monitor = GetOrCreateMonitor(owner); if (!monitor) { return(value); } monitor.Log(name, value, viz); return(value); #else return(value); #endif }
private void InternalUpdateObservation(Visualizsation viz, string name, float value) { if (!enabled) { return; } InternalCleanup(); if (!monitoring.TryGetValue(viz, out var visualizer)) { foreach (var provider in displayProviders) { if (provider.Type != viz) { continue; } visualizer = provider; break; } if (visualizer) { monitoring.Add(viz, visualizer); } } if (!visualizer || visualizer == null) { if (monitoring.ContainsKey(viz)) { monitoring.Remove(viz); } return; } visualizer.Append(name, value); }
public void Log(string key, float value, Visualizsation visual = Visualizsation.PlainValue) { InternalUpdateObservation(visual, key, value); }
public static Vector3 Visualize(this Vector3 value, string name, Component owner, Visualizsation viz = Visualizsation.PlainValue) { #if UNITY_EDITOR InternalVisualize(viz, owner, name, value.x); InternalVisualize(viz, owner, name, value.y); InternalVisualize(viz, owner, name, value.z); #endif return(value); }
public static float Visualize(this float value, string name, Component owner, Visualizsation viz = Visualizsation.PlainValue) { return(InternalVisualize(viz, owner, name, value)); }