Example #1
0
        } // PropagateCounterparts

        // Recurse through a branch and attach the highlighter function to each part.
        public void HighlighterHook(Part AttachedPart)
        {
            // Remove the highlighter whenever called. Prevents highlighter stacking.
            AttachedPart.RemoveOnMouseEnter(ActivateHighlight);
            AttachedPart.RemoveOnMouseExit(DeactivateHighlight);

            if (true == DebugHighlightActive)
            {
                AttachedPart.AddOnMouseEnter(ActivateHighlight);
                AttachedPart.AddOnMouseExit(DeactivateHighlight);
            }

            if (null == AttachedPart.children)
            {
                return;
            }

            for (int IndexChildren = 0; IndexChildren < AttachedPart.children.Count; IndexChildren++)
            {
                HighlighterHook(AttachedPart.children[IndexChildren]);
            }
        }
        // Recurse through a branch and attach the highlighter function to each part.
        public void HighlighterHook(Part AttachedPart)
        {
            //if (AttachedPart = null) { return; }

            // Remove the highlighter whenever called. Prevents highlighter stacking.
            AttachedPart.RemoveOnMouseEnter(ActivateHighlight);
            AttachedPart.RemoveOnMouseExit(DeactivateHighlight);

            if (true == DebugHighlightActive)
            {
                AttachedPart.AddOnMouseEnter(ActivateHighlight);
                AttachedPart.AddOnMouseExit(DeactivateHighlight);
            }

            if (null == AttachedPart.children) { return; }

            for (int IndexChildren = 0; IndexChildren < AttachedPart.children.Count; IndexChildren++)
            {
                HighlighterHook(AttachedPart.children[IndexChildren]);
            }
        }