mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] URP Sprite shader now allows Receive Shadow option when Write to Depth is disabled. This option has been greyed out unnecessarily. Closes #1839.
This commit is contained in:
parent
48470a4b16
commit
8908cdd15c
@ -679,9 +679,6 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
|
|||||||
IsURP3DShader(_materialEditor, out areMixedShaders);
|
IsURP3DShader(_materialEditor, out areMixedShaders);
|
||||||
|
|
||||||
if (hasReceiveShadowsParameter) {
|
if (hasReceiveShadowsParameter) {
|
||||||
bool forceDisableReceiveShadows = !_writeToDepth.hasMixedValue && _writeToDepth.floatValue == 0;
|
|
||||||
EditorGUI.BeginDisabledGroup(forceDisableReceiveShadows);
|
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
bool mixedValue;
|
bool mixedValue;
|
||||||
bool enableReceive = !IsKeywordEnabled(_materialEditor, "_RECEIVE_SHADOWS_OFF", out mixedValue);
|
bool enableReceive = !IsKeywordEnabled(_materialEditor, "_RECEIVE_SHADOWS_OFF", out mixedValue);
|
||||||
@ -690,11 +687,10 @@ public class SpineSpriteShaderGUI : SpineShaderWithOutlineGUI {
|
|||||||
|
|
||||||
EditorGUI.showMixedValue = false;
|
EditorGUI.showMixedValue = false;
|
||||||
|
|
||||||
if (EditorGUI.EndChangeCheck() || forceDisableReceiveShadows) {
|
if (EditorGUI.EndChangeCheck()) {
|
||||||
SetKeyword(_materialEditor, "_RECEIVE_SHADOWS_OFF", !enableReceive || forceDisableReceiveShadows);
|
SetKeyword(_materialEditor, "_RECEIVE_SHADOWS_OFF", !enableReceive);
|
||||||
dataChanged = true;
|
dataChanged = true;
|
||||||
}
|
}
|
||||||
EditorGUI.EndDisabledGroup(); // forceDisableReceiveShadows
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dataChanged;
|
return dataChanged;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user