Skip to content

Commit 099e321

Browse files
committed
Added Render queue support to lowend shader inspector.
1 parent 09ec657 commit 099e321

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Assets/LowEndMobilePipeline/Editor/LowendMobilePipelineMaterialEditor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using UnityEditor;
33
using UnityEngine;
4+
using UnityEngine.Rendering;
45

56
public class LowendMobilePipelineMaterialEditor : ShaderGUI
67
{
@@ -142,6 +143,11 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro
142143
EditorGUILayout.Space();
143144
EditorGUILayout.Space();
144145

146+
materialEditor.RenderQueueField();
147+
148+
EditorGUILayout.Space();
149+
EditorGUILayout.Space();
150+
145151
if ((BlendMode)blendModeProp.floatValue == BlendMode.Cutout)
146152
{
147153
Styles.warningStyle.normal.textColor = Color.yellow;
@@ -259,6 +265,7 @@ private void UpdateMaterialBlendMode(Material material)
259265
material.SetInt("_ZWrite", 1);
260266
SetKeyword(material, "_ALPHATEST_ON", false);
261267
SetKeyword(material, "_ALPHABLEND_ON", false);
268+
material.renderQueue = -1;
262269
break;
263270

264271
case BlendMode.Cutout:
@@ -268,6 +275,7 @@ private void UpdateMaterialBlendMode(Material material)
268275
material.SetInt("_ZWrite", 1);
269276
SetKeyword(material, "_ALPHATEST_ON", true);
270277
SetKeyword(material, "_ALPHABLEND_ON", false);
278+
material.renderQueue = (int)RenderQueue.AlphaTest;
271279
break;
272280

273281
case BlendMode.Alpha:
@@ -277,6 +285,7 @@ private void UpdateMaterialBlendMode(Material material)
277285
material.SetInt("_ZWrite", 0);
278286
SetKeyword(material, "_ALPHATEST_ON", false);
279287
SetKeyword(material, "_ALPHABLEND_ON", true);
288+
material.renderQueue = (int) RenderQueue.Transparent;
280289
break;
281290
}
282291
}

0 commit comments

Comments
 (0)