- Home /
Question by
$$anonymous$$ · Aug 11, 2018 at 12:14 PM ·
shaderinspectorrendererpropertiesrenderqueue
How to Add Render Queue property in Inspector to LightWeight Shader ?
Hi guys! Im currently trying to use new lightweight srp, and i need to change render queue in order to draw outline behind object. Its easy to change it by script material.renderQueue = 3000;
, but in order to see changes you need to hit play. Is there any solutions to add renderqueue property to inspector?
This guys somehow solved this https://forum.unity.com/threads/setting-the-render-queue-for-standard-shader.508767/.
Maybe there is easier solutions? Thanks in advance!
Comment
Best Answer
Answer by $$anonymous$$ · Aug 11, 2018 at 01:27 PM
Find Solution if anyone interested.
First of all Added RenderQueue field it self.
protected void DoMaterialRenderingOptions()
{
EditorGUILayout.Space();
GUILayout.Label(Styles.renderingOptionsLabel, EditorStyles.boldLabel);
m_MaterialEditor.EnableInstancingField();
m_MaterialEditor.DoubleSidedGIField();
m_MaterialEditor.RenderQueueField();
}
But it wasnt saving if you load scene or restart editor.
Added this lines and it works properly.
if (m_FirstTimeApply)
{
int renderQueue = material.renderQueue;
MaterialChanged(material);
material.renderQueue = renderQueue;
m_FirstTimeApply = false;
}
Thanks to guy from chat tomix1024.