Should preserve the properties when cloning material.

pull/81/head
Paul Young 2020-05-02 13:37:42 +09:00
parent 579330f269
commit f7741dc7ee
1 changed files with 2 additions and 1 deletions

View File

@ -73,6 +73,7 @@ namespace Coffee.UIExtensions
if (_softMask) if (_softMask)
{ {
result = new Material(baseMaterial); result = new Material(baseMaterial);
result.CopyPropertiesFromMaterial(baseMaterial);
result.hideFlags = HideFlags.HideAndDontSave; result.hideFlags = HideFlags.HideAndDontSave;
result.SetTexture(s_SoftMaskTexId, _softMask.softMaskBuffer); result.SetTexture(s_SoftMaskTexId, _softMask.softMaskBuffer);
result.SetInt(s_StencilCompId, m_UseStencil ? (int)CompareFunction.Equal : (int)CompareFunction.Always); result.SetInt(s_StencilCompId, m_UseStencil ? (int)CompareFunction.Equal : (int)CompareFunction.Always);