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