コード例 #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
        }
コード例 #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
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public void Log(string key, float value, Visualizsation visual = Visualizsation.PlainValue)
 {
     InternalUpdateObservation(visual, key, value);
 }
コード例 #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);
        }
コード例 #6
0
 public static float Visualize(this float value, string name, Component owner, Visualizsation viz = Visualizsation.PlainValue)
 {
     return(InternalVisualize(viz, owner, name, value));
 }