IsMaterialCorrect() private static method

private static IsMaterialCorrect ( Material material ) : bool
material UnityEngine.Material
return bool
Example #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);
        }
Example #2
0
        public bool NodeHasWrongMaterial(TreeGroup group)
        {
            bool flag = false;

            if (group is TreeGroupBranch)
            {
                TreeGroupBranch treeGroupBranch = group as TreeGroupBranch;
                flag |= !TreeEditorHelper.IsMaterialCorrect(treeGroupBranch.materialBranch);
                flag |= !TreeEditorHelper.IsMaterialCorrect(treeGroupBranch.materialBreak);
                flag |= !TreeEditorHelper.IsMaterialCorrect(treeGroupBranch.materialFrond);
            }
            else
            {
                if (group is TreeGroupLeaf)
                {
                    TreeGroupLeaf treeGroupLeaf = group as TreeGroupLeaf;
                    flag |= !TreeEditorHelper.IsMaterialCorrect(treeGroupLeaf.materialLeaf);
                }
            }
            return(flag);
        }