|
|
|
|
|
|
using System; |
|
|
|
using UnityEditor; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Rendering; |
|
|
|
|
|
|
|
public class LowendMobilePipelineMaterialEditor : ShaderGUI |
|
|
|
{ |
|
|
|
|
|
|
EditorGUILayout.Space(); |
|
|
|
EditorGUILayout.Space(); |
|
|
|
|
|
|
|
materialEditor.RenderQueueField(); |
|
|
|
|
|
|
|
EditorGUILayout.Space(); |
|
|
|
EditorGUILayout.Space(); |
|
|
|
|
|
|
|
if ((BlendMode)blendModeProp.floatValue == BlendMode.Cutout) |
|
|
|
{ |
|
|
|
Styles.warningStyle.normal.textColor = Color.yellow; |
|
|
|
|
|
|
material.SetInt("_ZWrite", 1); |
|
|
|
SetKeyword(material, "_ALPHATEST_ON", false); |
|
|
|
SetKeyword(material, "_ALPHABLEND_ON", false); |
|
|
|
material.renderQueue = -1; |
|
|
|
break; |
|
|
|
|
|
|
|
case BlendMode.Cutout: |
|
|
|
|
|
|
material.SetInt("_ZWrite", 1); |
|
|
|
SetKeyword(material, "_ALPHATEST_ON", true); |
|
|
|
SetKeyword(material, "_ALPHABLEND_ON", false); |
|
|
|
material.renderQueue = (int)RenderQueue.AlphaTest; |
|
|
|
break; |
|
|
|
|
|
|
|
case BlendMode.Alpha: |
|
|
|
|
|
|
material.SetInt("_ZWrite", 0); |
|
|
|
SetKeyword(material, "_ALPHATEST_ON", false); |
|
|
|
SetKeyword(material, "_ALPHABLEND_ON", true); |
|
|
|
material.renderQueue = (int) RenderQueue.Transparent; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|