Beispiel #1
0
        public static void DrawTagHelpLabel()
        {
            string tagsText = TextTagParser.GetTagHelp();

            if (CustomTag.activeCustomTags.Count > 0)
            {
                tagsText += "\n\n\t-------- CUSTOM TAGS --------";
                List <Transform> activeCustomTagGroup = new List <Transform>();
                foreach (CustomTag ct in CustomTag.activeCustomTags)
                {
                    if (ct.transform.parent != null)
                    {
                        if (!activeCustomTagGroup.Contains(ct.transform.parent.transform))
                        {
                            activeCustomTagGroup.Add(ct.transform.parent.transform);
                        }
                    }
                    else
                    {
                        activeCustomTagGroup.Add(ct.transform);
                    }
                }
                foreach (Transform parent in activeCustomTagGroup)
                {
                    string    tagName        = parent.name;
                    string    tagStartSymbol = "";
                    string    tagEndSymbol   = "";
                    CustomTag parentTag      = parent.GetComponent <CustomTag>();
                    if (parentTag != null)
                    {
                        tagName        = parentTag.name;
                        tagStartSymbol = parentTag.TagStartSymbol;
                        tagEndSymbol   = parentTag.TagEndSymbol;
                    }
                    tagsText += "\n\n\t" + tagStartSymbol + " " + tagName + " " + tagEndSymbol;
                    foreach (Transform child in parent)
                    {
                        tagName        = child.name;
                        tagStartSymbol = "";
                        tagEndSymbol   = "";
                        CustomTag childTag = child.GetComponent <CustomTag>();
                        if (childTag != null)
                        {
                            tagName        = childTag.name;
                            tagStartSymbol = childTag.TagStartSymbol;
                            tagEndSymbol   = childTag.TagEndSymbol;
                        }
                        tagsText += "\n\t      " + tagStartSymbol + " " + tagName + " " + tagEndSymbol;
                    }
                }
            }
            tagsText += "\n";
            float pixelHeight = EditorStyles.miniLabel.CalcHeight(new GUIContent(tagsText), EditorGUIUtility.currentViewWidth);

            EditorGUILayout.SelectableLabel(tagsText, GUI.skin.GetStyle("HelpBox"), GUILayout.MinHeight(pixelHeight));
        }
Beispiel #2
0
        public static void DrawTagHelpLabel()
        {
            string tagsText = "";

            tagsText += "\n";
            tagsText += TextTagParser.GetTagHelp();

            float pixelHeight = EditorStyles.miniLabel.CalcHeight(new GUIContent(tagsText), EditorGUIUtility.currentViewWidth);

            EditorGUILayout.SelectableLabel(tagsText, GUI.skin.GetStyle("HelpBox"), GUILayout.MinHeight(pixelHeight));
        }