Skip to content

Commit

Permalink
Unity: Prevent destroy problem with ExecuteInEditMode
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed Jun 6, 2014
1 parent bf62a39 commit 5ea0333
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file modified csharp/unity/dist/lwf.unitypackage
Binary file not shown.
3 changes: 2 additions & 1 deletion csharp/unity/renderer/bitmapfont/bitmapfont_renderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,8 @@ public virtual void RenderNow(Matrix4x4 matrix, Color multColor)
material.color = multColor;
material.SetPass(0);
Graphics.DrawMeshNow(mMesh, matrix);
Material.Destroy(material);
if (!Application.isEditor)
Material.Destroy(material);
}
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion csharp/unity/renderer/drawmesh/lwf_drawmesh_bitmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ public override void RenderNow()
material.SetColor("_AdditionalColor", m_colorAdd);
material.SetPass(0);
Graphics.DrawMeshNow(m_context.mesh, m_renderMatrix);
Material.Destroy(material);
if (!Application.isEditor)
Material.Destroy(material);
}
#endif
}
Expand Down

0 comments on commit 5ea0333

Please sign in to comment.