Add null check for prefab editor

pull/24/head
mob-sakai 2018-12-15 20:20:14 +09:00
parent f4b7954947
commit e62788c709
2 changed files with 11 additions and 5 deletions

View File

@ -339,10 +339,13 @@ namespace Coffee.UIExtensions
static void UpdateMaskTextures()
{
foreach (var sm in s_ActiveSoftMasks)
{
if(sm)
{
sm.UpdateMaskTexture ();
}
}
}
/// <summary>
/// Update the mask texture.

View File

@ -157,6 +157,8 @@ namespace Coffee.UIExtensions
Matrix4x4 prj = cam.projectionMatrix;
foreach (var sm in s_ActiveSoftMaskables)
{
if(sm)
{
Material mat = sm._maskMaterial;
if (mat)
@ -166,6 +168,7 @@ namespace Coffee.UIExtensions
}
}
}
}
/// <summary>
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).