GetGUIContent() public static method

public static GetGUIContent ( string id ) : GUIContent
id string
return UnityEngine.GUIContent
Exemplo n.º 1
0
        public bool GUIWrongShader(string uniqueID, Material value, TreeEditorHelper.NodeType nodeType)
        {
            GUIContent gUIContent  = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroup.NotATreeShader");
            GUIContent gUIContent2 = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroup.ChangeShaderButton");

            if (TreeEditorHelper.IsMaterialCorrect(value))
            {
                return(false);
            }
            List <string> recommendedShaders = this.GetRecommendedShaders(nodeType);

            this.m_WrongShaders.Add(uniqueID);
            this.SetAnimBool(uniqueID, true, true);
            int num = this.GUIShowError(uniqueID, recommendedShaders, gUIContent, gUIContent2, ConsoleWindow.iconError);

            if (num >= 0)
            {
                value.shader = Shader.Find(recommendedShaders[num]);
                this.m_WrongShaders.Remove(uniqueID);
                this.DisableAnimBool(uniqueID);
                this.RemoveSelectedIndex(uniqueID);
                return(true);
            }
            return(false);
        }
Exemplo n.º 2
0
        private bool GUITooManyShaders(TreeEditorHelper.NodeType nodeType)
        {
            string text = nodeType.ToString();

            if (this.CheckForTooManyShaders(nodeType))
            {
                this.SetAnimBool(text, true, true);
            }
            List <string> shadersListForNodeType = this.GetShadersListForNodeType(nodeType);
            GUIContent    gUIContent             = TreeEditorHelper.GetGUIContent((nodeType != TreeEditorHelper.NodeType.BarkNode) ? "TreeEditor.TreeGroup.TooManyLeafShaders" : "TreeEditor.TreeGroup.TooManyBarkShaders");
            GUIContent    gUIContent2            = TreeEditorHelper.GetGUIContent("TreeEditor.TreeGroup.ChangeAllShadersOnNodesButton");
            int           num = this.GUIShowError(text, shadersListForNodeType, gUIContent, gUIContent2, ConsoleWindow.iconError);

            if (num >= 0)
            {
                Shader shader = Shader.Find(shadersListForNodeType[num]);
                TreeEditorHelper.ChangeShaderOnMaterials(this.m_TreeData, shader, this.m_TreeData.root, nodeType);
                this.DisableAnimBool(text);
                this.RemoveSelectedIndex(text);
                return(true);
            }
            return(false);
        }