Skip to content

Commit

Permalink
Add null check for prefab editor
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Dec 17, 2018
1 parent 74f6180 commit a0e32d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Scripts/SoftMask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ static void UpdateMaskTextures()
{
foreach (var sm in s_ActiveSoftMasks)
{
sm.UpdateMaskTexture();
if(sm)
{
sm.UpdateMaskTexture ();
}
}
}

Expand Down
11 changes: 7 additions & 4 deletions Scripts/SoftMaskable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,14 @@ static void UpdateSceneViewMatrixForShader()

foreach (var sm in s_ActiveSoftMaskables)
{
Material mat = sm._maskMaterial;
if (mat)
if(sm)
{
mat.SetMatrix("_SceneView", w2c);
mat.SetMatrix("_SceneProj", prj);
Material mat = sm._maskMaterial;
if (mat)
{
mat.SetMatrix ("_SceneView", w2c);
mat.SetMatrix ("_SceneProj", prj);
}
}
}
}
Expand Down

0 comments on commit a0e32d6

Please sign in to comment.