Skip to content

Commit 887f424

Browse files
committed
fix
1 parent 0a372a5 commit 887f424

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Editor/Util/Util.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public static void SetMaterialSlot(this GameObject gameObject, int index, Materi
5858
var materials = renderer.sharedMaterials;
5959
if (index < 0 || index >= materials.Length) return;
6060
materials[index] = material;
61+
#if UNITY_EDITOR
6162
UnityEditor.Undo.RecordObject(renderer, "Set Material Slot");
63+
#endif
6264
renderer.sharedMaterials = materials;
6365
}
6466

0 commit comments

Comments
 (0)