diff --git a/Source/MaterialDef.cs b/Source/MaterialDef.cs index fa0360e..9ef480e 100644 --- a/Source/MaterialDef.cs +++ b/Source/MaterialDef.cs @@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License using System.Runtime.CompilerServices; using HarmonyLib; using UnityEngine; +using Object = UnityEngine.Object; namespace Shabby { @@ -147,7 +148,7 @@ public Material Instantiate(Material referenceMaterial) Material material; if (updateExisting) { - material = new Material(referenceMaterial); + material = Object.Instantiate(referenceMaterial); if (shader != null) material.shader = shader; } else { material = new Material(shader) { name = referenceMaterial.name };