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)
{
result = new Material(baseMaterial);
result.CopyPropertiesFromMaterial(baseMaterial);
result.hideFlags = HideFlags.HideAndDontSave;
result.SetTexture(s_SoftMaskTexId, _softMask.softMaskBuffer);
result.SetInt(s_StencilCompId, m_UseStencil ? (int)CompareFunction.Equal : (int)CompareFunction.Always);
@ -326,4 +327,4 @@ namespace Coffee.UIExtensions
#pragma warning restore 0612
}
}
}
}