Ejemplo n.º 1
0
    void ListKeywords(Material mat, GUIContent label, float buttonSize)
    {
        keywordsList.Clear();
        foreach (string s in mat.shaderKeywords)
        {
            keywordsList.Add(s);
        }

        if (MGUI.LinkButton(label, buttonSize, buttonSize, (MGUI.GetInspectorWidth() / 2.0f) - 11.0f))
        {
            displayKeywords = !displayKeywords;
        }

        if (displayKeywords)
        {
            MGUI.Space8();
            string infoString = "";
            if (keywordsList.Capacity == 0)
            {
                infoString = "NO KEYWORDS FOUND";
            }
            else
            {
                infoString = "\nKeywords Used:\n\n";
                foreach (string s in keywordsList)
                {
                    infoString += " " + s + "\n";
                }
            }
            MGUI.DisplayText(infoString);
            MGUI.SpaceN8();
        }
        GUILayout.Space(buttonSize - 10);
    }