11using System ;
22using UnityEditor ;
33using UnityEngine ;
4+ using UnityEngine . Rendering ;
45
56public 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