Beispiel #1
0
        // Called when the node enters the scene tree for the first time.
        public override void _Ready()
        {
            // Do not show unless we are in debug mode
            if (!OS.IsDebugBuild())
            {
                QueueFree();
                return;
            }

            OnScreenDebugControl    = FindNode("OnScreenDebug") as OnScreenDebugInterface;
            DebugButtonMenu         = FindNode("DebugButtonMenu") as DebugButtonMenu;
            DebugButtonMenu.Visible = false;
            if (GetTheme() != null)
            {
                DebugButtonMenu.Theme = GetTheme();
            }

            // Add basic stuff to OnScreenDebug (FPS)
            OnScreenDebugManager.Initialize();
        }
Beispiel #2
0
        private void ProcessOnScreenDebugAttributeForMethod(MethodInfo info, Node node, bool add)
        {
            OnScreenDebug attr = DebugReflectionUtil.GetCustomAttribute <OnScreenDebug>(info) as OnScreenDebug;

            if (attr != null)
            {
                if (add)
                {
                    // Add
                    OnScreenDebugManager.AddOnScreenDebugInfo(ReplaceName(attr.DebugCategory, node),
                                                              ReplaceName(attr.Name, node), () => GetValueOfMethod(info, node), attr.Color);
                }
                else
                {
                    // Remove
                    OnScreenDebugManager.RemoveOnScreenDebugInfo(ReplaceName(attr.DebugCategory, node),
                                                                 ReplaceName(attr.Name, node));
                }
            }
        }