From 68bf9d60df569d009c673a1909aa4a6918dced9a Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 9 Dec 2019 15:53:48 +0100 Subject: [PATCH] [unity] Fixed error when querying outline properties at LWRP shaders. Closes #1565. --- .../Shaders/SpineShaderWithOutlineGUI.cs | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs index 880e4fbc3..7dcde59e7 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Shaders/SpineShaderWithOutlineGUI.cs @@ -76,17 +76,21 @@ public class SpineShaderWithOutlineGUI : ShaderGUI { #region Virtual Interface protected virtual void FindProperties (MaterialProperty[] props) { - _OutlineWidth = FindProperty("_OutlineWidth", props); - _OutlineReferenceTexWidth = FindProperty("_OutlineReferenceTexWidth", props); - _OutlineColor = FindProperty("_OutlineColor", props); - _ThresholdEnd = FindProperty("_ThresholdEnd", props); - _OutlineSmoothness = FindProperty("_OutlineSmoothness", props); - _Use8Neighbourhood = FindProperty("_Use8Neighbourhood", props); - _OutlineMipLevel = FindProperty("_OutlineMipLevel", props); + + _OutlineWidth = FindProperty("_OutlineWidth", props, false); + _OutlineReferenceTexWidth = FindProperty("_OutlineReferenceTexWidth", props, false); + _OutlineColor = FindProperty("_OutlineColor", props, false); + _ThresholdEnd = FindProperty("_ThresholdEnd", props, false); + _OutlineSmoothness = FindProperty("_OutlineSmoothness", props, false); + _Use8Neighbourhood = FindProperty("_Use8Neighbourhood", props, false); + _OutlineMipLevel = FindProperty("_OutlineMipLevel", props, false); } protected virtual void RenderOutlineProperties () { + if (_OutlineWidth == null) + return; // not an outline shader + // Use default labelWidth EditorGUIUtility.labelWidth = 0f;