diff --git a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs index 953cd68..cf4530d 100755 --- a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs +++ b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs @@ -409,10 +409,8 @@ namespace Coffee.UIExtensions List _children = new List(); bool _hasChanged = false; bool _hasStencilStateChanged = false; -#if !UNITY_2018_1_OR_NEWER static readonly Dictionary s_previousViewProjectionMatrices = new Dictionary (); static readonly Dictionary s_nowViewProjectionMatrices = new Dictionary (); -#endif Material material { get { return _material ? _material : _material = new Material(s_SoftMaskShader ? s_SoftMaskShader : s_SoftMaskShader = Resources.Load("SoftMask")){ hideFlags = HideFlags.HideAndDontSave }; } } @@ -438,18 +436,14 @@ namespace Coffee.UIExtensions if(!cam) continue; - Matrix4x4 nowsVP = cam.projectionMatrix * cam.worldToCameraMatrix; + Matrix4x4 nowVP = cam.projectionMatrix * cam.worldToCameraMatrix; -#if UNITY_2018_1_OR_NEWER - Matrix4x4 previousVP = cam.previousViewProjectionMatrix; -#else Matrix4x4 previousVP = default(Matrix4x4); int id = cam.GetInstanceID (); s_previousViewProjectionMatrices.TryGetValue (id, out previousVP); - s_nowViewProjectionMatrices[id] = nowsVP; -#endif + s_nowViewProjectionMatrices[id] = nowVP; - if (previousVP != nowsVP) + if (previousVP != nowVP) { sm.hasChanged = true; }