Ejemplo n.º 1
0
        public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] props)
        {
            material            = materialEditor.target as Material;
            this.props          = props;
            this.materialEditor = materialEditor;

            // Init
            Prop.Initialize(props);
            Layout.Initialize(materialEditor);
            ShaderSetup.Initialize(materialEditor);

            if (ShaderSetup.isProjector)
            {
                ShaderPropertiesGUI(material);
            }
            else
            {
                base.OnGUI(materialEditor, props);
            }

            if (firstTimeApply)
            {
                ShaderSetup.MaterialChanged();
                firstTimeApply = false;
            }
        }
Ejemplo n.º 2
0
 public override void ShaderPropertiesGUI(Material material)
 {
     EditorGUILayout.BeginHorizontal();
     GUILayout.Space(-7);
     EditorGUILayout.BeginVertical();
     EditorGUI.BeginChangeCheck();
     DrawGUI();
     if (EditorGUI.EndChangeCheck())
     {
         ShaderSetup.MaterialChanged();
     }
     EditorGUILayout.EndVertical();
     GUILayout.Space(1);
     EditorGUILayout.EndHorizontal();
 }
Ejemplo n.º 3
0
 public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader)
 {
     ShaderSetup.Initialize(material, newShader);
     base.AssignNewShaderToMaterial(material, oldShader, newShader);
     ShaderSetup.MaterialChanged();
 }