I'm using the URP Spine Shader in ( Universal Render Pipeline/2D/Spine/Sprite ) path.
I wanna access the value 'Lighting Mode' in runtime and change the value.
How can I access to this variable in my script?
How can I access the URP Sprite Shader Code Variable
@swnyy The Lighting Mode
property is just an Editor GUI parameter which switches between shaders. You can check out the code in SpineSpriteShaderGUI.cs, line 368.
Why would want to change Lighting Mode
at runtime when using URP? When using URP with a 2D Renderer, the only valid Sprite shader is "Universal Render Pipeline/2D/Spine/Sprite"
and when using URP with a normal (non-2D) Renderer, "Universal Render Pipeline/Spine/Sprite"
is the only valid one.
Thanks for the clarification.
swnyy Is there a way to change this in the script in runtime?
Is just changing the shader the only way?
Changing the shader is the only way to change the shader, yes .
https://docs.unity3d.com/ScriptReference/Material-shader.html
Why do you want to avoid changing the shader?
Of course you could also prepare a second Material with the second shader and then switch Materials.