From c7e2fa27106cd2a345748882764c1ed68726f26a Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Tue, 28 Jan 2020 18:46:48 +0900 Subject: [PATCH] fix: Update softmask not working when canvas component was deactivated Close #66 --- .../Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs index c35b4fa..953cd68 100755 --- a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs +++ b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs @@ -429,9 +429,15 @@ namespace Coffee.UIExtensions continue; var canvas = sm.graphic.canvas; + if(!canvas) + continue; + if (canvas.renderMode == RenderMode.WorldSpace) { var cam = canvas.worldCamera; + if(!cam) + continue; + Matrix4x4 nowsVP = cam.projectionMatrix * cam.worldToCameraMatrix; #if UNITY_2018_1_OR_NEWER