예제 #1
0
 private void ShaderPropertiesGUI(Material material)
 {
     EditorGUIUtility.labelWidth = 0f;
     EditorGUILayout.Space();
     EditorGUI.BeginChangeCheck();
     {
         BlendModePopup();
         AKSUIHelper.ShurikenHeader(AKSStyles.primaryMapsText);
         GUILayout.Label(AKSStyles.mainTitle, EditorStyles.boldLabel);
         m_MaterialEditor.TexturePropertySingleLine(AKSStyles.albedoText, albedoMap, albedoColor);
         if (((BlendMode)material.GetFloat("_ModeU") == BlendMode.Cutout))
         {
             m_MaterialEditor.ShaderProperty(alphaCutoff, AKSStyles.alphaCutoffText.text, MaterialEditor.kMiniTextureFieldLabelIndentLevel + 1);
         }
         EditorGUI.indentLevel += 2;
         m_MaterialEditor.TextureScaleOffsetProperty(albedoMap);
         EditorGUI.indentLevel -= 2;
         AKSUIHelper.ShurikenHeader("Options");
         GUILayout.Label(AKSStyles.renderingOpTitle, EditorStyles.boldLabel);
         EditorGUI.indentLevel++;
         m_MaterialEditor.ShaderProperty(cullMode, AKSStyles.cullModeText);
         m_MaterialEditor.RenderQueueField();
         EditorGUI.indentLevel--;
     }
     if (EditorGUI.EndChangeCheck())
     {
         foreach (UnityEngine.Object obj in blendMode.targets)
         {
             MaterialChanged((Material)obj);
         }
     }
     AKSUIHelper.ShurikenHeader(AKSStyles.nameAKUnlit);
     EditorGUILayout.LabelField(AKSStyles.author);
     AKSManager.DisplayVersion();
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(AKSStyles.btnReadme))
     {
         AKSUIHelper.OpenLink(AKSStyles.linkReadme);
     }
     if (GUILayout.Button(AKSStyles.btnDescription))
     {
         AKSUIHelper.OpenLink(AKSStyles.linkDescriptionAKUnlit);
     }
     EditorGUILayout.EndHorizontal();
 }
예제 #2
0
 private void ShaderPropertiesGUI(Material material)
 {
     EditorGUIUtility.labelWidth = 0f;
     EditorGUILayout.Space();
     EditorGUI.BeginChangeCheck();
     {
         BlendModePopup();
         foldMain = AKSUIHelper.ShurikenFoldout(AKSStyles.primaryMapsText, foldMain);
         if (foldMain)
         {
             GUILayout.Label(AKSStyles.mainTitle, EditorStyles.boldLabel);
             DoAlbedoArea(material);
             DoNormalArea();
             m_MaterialEditor.TexturePropertySingleLine(AKSStyles.heightMapText, heightMap, heightMap.textureValue != null ? heigtMapScale : null);
             m_MaterialEditor.TexturePropertySingleLine(AKSStyles.occlusionText, occlusionMap, occlusionMap.textureValue != null ? occlusionStrength : null);
             GUILayout.Label(AKSStyles.emissionTitle, EditorStyles.boldLabel);
             DoEmissionArea(material);
             GUILayout.Label(AKSStyles.reflectionTitle, EditorStyles.boldLabel);
             DoSpecularMetallicArea();
             GUILayout.Label(AKSStyles.scaleOffsetTitle, EditorStyles.boldLabel);
             EditorGUI.indentLevel += 2;
             EditorGUI.BeginChangeCheck();
             {
                 m_MaterialEditor.TextureScaleOffsetProperty(albedoMap);
             }
             if (EditorGUI.EndChangeCheck())
             {
                 emissionMap.textureScaleAndOffset = albedoMap.textureScaleAndOffset;
             }
             EditorGUI.indentLevel -= 2;
         }
         foldSecond = AKSUIHelper.ShurikenFoldout(AKSStyles.secondaryMapsText, foldSecond);
         if (foldSecond)
         {
             GUILayout.Label(AKSStyles.detailTitle, EditorStyles.boldLabel);
             m_MaterialEditor.TexturePropertySingleLine(AKSStyles.detailMaskText, detailMask);
             m_MaterialEditor.TexturePropertySingleLine(AKSStyles.detailAlbedoText, detailAlbedoMap);
             m_MaterialEditor.TexturePropertySingleLine(AKSStyles.detailNormalMapText, detailNormalMap, detailNormalMapScale);
             EditorGUI.indentLevel += 3;
             m_MaterialEditor.TextureScaleOffsetProperty(detailAlbedoMap);
             EditorGUI.indentLevel--;
             m_MaterialEditor.ShaderProperty(uvSetSecondary, AKSStyles.uvSetLabel.text);
             EditorGUI.indentLevel -= 2;
         }
         foldOption = AKSUIHelper.ShurikenFoldout(AKSStyles.options, foldOption);
         if (foldOption)
         {
             GUILayout.Label(AKSStyles.forwardText, EditorStyles.boldLabel);
             EditorGUI.indentLevel += 1;
             if (highlights != null)
             {
                 m_MaterialEditor.ShaderProperty(highlights, AKSStyles.highlightsText);
             }
             if (reflections != null)
             {
                 m_MaterialEditor.ShaderProperty(reflections, AKSStyles.reflectionsText);
             }
             EditorGUI.indentLevel -= 1;
             GUILayout.Label(AKSStyles.renderingOpTitle, EditorStyles.boldLabel);
             EditorGUI.indentLevel += 1;
             m_MaterialEditor.ShaderProperty(cullMode, AKSStyles.cullModeText);
             m_MaterialEditor.RenderQueueField();
             //m_MaterialEditor.ShaderProperty(ztest, "Z Test");
             //m_MaterialEditor.ShaderProperty(zwrite, "Z Write");
             //m_MaterialEditor.ShaderProperty(srcFactor, "Src Factor");
             //m_MaterialEditor.ShaderProperty(dstFactor, "Dst Factor");
             EditorGUI.indentLevel -= 1;
             GUILayout.Label(AKSStyles.advancedText, EditorStyles.boldLabel);
             EditorGUI.indentLevel += 1;
             m_MaterialEditor.EnableInstancingField();
             m_MaterialEditor.DoubleSidedGIField();
             EditorGUI.indentLevel -= 1;
         }
     }
     if (EditorGUI.EndChangeCheck())
     {
         foreach (UnityEngine.Object obj in blendMode.targets)
         {
             MaterialChanged((Material)obj, m_WorkflowMode);
         }
     }
     AKSUIHelper.ShurikenHeader(AKSStyles.nameAKStandard);
     EditorGUILayout.LabelField(AKSStyles.author);
     AKSManager.DisplayVersion();
     EditorGUILayout.Space();
     EditorGUILayout.BeginHorizontal();
     if (GUILayout.Button(AKSStyles.btnReadme))
     {
         AKSUIHelper.OpenLink(AKSStyles.linkReadme);
     }
     if (GUILayout.Button(AKSStyles.btnDescription))
     {
         AKSUIHelper.OpenLink(AKSStyles.linkDescriptionAKStandard);
     }
     EditorGUILayout.EndHorizontal();
 }