Exemplo n.º 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));
        }
Exemplo n.º 2
0
        static public void DrawTagHelpLabel()
        {
            string tagsText = "";

            tagsText += "\n";
            tagsText += "\t-------- DEFAULT TAGS --------\n\n";
            tagsText += "" +
                        "\t{b} Bold Text {/b}\n" +
                        "\t{i} Italic Text {/i}\n" +
                        "\t{color=red} Color Text (color){/color}\n" +
                        "\n" +
                        "\t{s}, {s=60} Writing speed (chars per sec){/s}\n" +
                        "\t{w}, {w=0.5} Wait (seconds)\n" +
                        "\t{wi} Wait for input\n" +
                        "\t{wc} Wait for input and clear\n" +
                        "\t{wp}, {wp=0.5} Wait on punctuation (seconds){/wp}\n" +
                        "\t{c} Clear\n" +
                        "\t{x} Exit, advance to the next command without waiting for input\n" +
                        "\n" +
                        "\t{vpunch=0.5} Vertically punch screen (intensity)\n" +
                        "\t{hpunch=0.5} Horizontally punch screen (intensity)\n" +
                        "\t{shake=1} Shake screen (intensity)\n" +
                        "\t{shiver=1} Shiver screen (intensity)\n" +
                        "\t{flash=0.5} Flash screen (duration)\n" +
                        "\n" +
                        "\t{audio=AudioObjectName} Play Audio Once\n" +
                        "\t{audioloop=AudioObjectName} Play Audio Loop\n" +
                        "\t{audiopause=AudioObjectName} Pause Audio\n" +
                        "\t{audiostop=AudioObjectName} Stop Audio\n" +
                        "\n" +
                        "\t{m} Broadcast message\n" +
                        "\t{$VarName} Substitute variable";
            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));
        }