From 702655b90f3e55237e8da893f6cbd4966e70f9fa Mon Sep 17 00:00:00 2001 From: mob-sakai Date: Sun, 30 Dec 2018 10:47:30 +0900 Subject: [PATCH] fix #23; An error occur when SoftMask is destroyed on editor --- .../Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs index 94ed6d3..3d44849 100644 --- a/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs +++ b/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs @@ -413,6 +413,11 @@ namespace Coffee.UIExtensions /// void UpdateMaskTexture() { + if(!graphic || !graphic.canvas) + { + return; + } + Transform stopAfter = MaskUtilities.FindRootSortOverrideCanvas(transform); _stencilDepth = MaskUtilities.GetStencilDepth(transform, stopAfter);