Ejemplo n.º 1
0
        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
        }
Ejemplo n.º 2
0
        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);
 }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
 public static float Visualize(this float value, string name, Component owner, Visualizsation viz = Visualizsation.PlainValue)
 {
     return(InternalVisualize(viz, owner, name, value));
 }