Add null check for prefab editor
parent
74f6180547
commit
a0e32d6f66
|
@ -339,10 +339,13 @@ namespace Coffee.UIExtensions
|
||||||
static void UpdateMaskTextures()
|
static void UpdateMaskTextures()
|
||||||
{
|
{
|
||||||
foreach (var sm in s_ActiveSoftMasks)
|
foreach (var sm in s_ActiveSoftMasks)
|
||||||
|
{
|
||||||
|
if(sm)
|
||||||
{
|
{
|
||||||
sm.UpdateMaskTexture ();
|
sm.UpdateMaskTexture ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update the mask texture.
|
/// Update the mask texture.
|
||||||
|
|
|
@ -157,6 +157,8 @@ namespace Coffee.UIExtensions
|
||||||
Matrix4x4 prj = cam.projectionMatrix;
|
Matrix4x4 prj = cam.projectionMatrix;
|
||||||
|
|
||||||
foreach (var sm in s_ActiveSoftMaskables)
|
foreach (var sm in s_ActiveSoftMaskables)
|
||||||
|
{
|
||||||
|
if(sm)
|
||||||
{
|
{
|
||||||
Material mat = sm._maskMaterial;
|
Material mat = sm._maskMaterial;
|
||||||
if (mat)
|
if (mat)
|
||||||
|
@ -166,6 +168,7 @@ namespace Coffee.UIExtensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).
|
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).
|
||||||
|
|
Loading…
Reference in New Issue