Beispiel #1
0
 public override void _EnterTree()
 {
     // This is done in _EnterTree so that we get the signal of other autoloads being added to the tree
     Instance = this;
     OnScreenDebug.Init();
     GetTree().Connect("node_added", this, nameof(OnNodeAdded));
     GetTree().Connect("node_removed", this, nameof(OnNodeRemoved));
 }
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));
                }
            }
        }