예제 #1
0
        static public 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));
        }
예제 #2
0
        static public 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));
        }