fix(PerlineNoise): fixed error for Undo

This commit is contained in:
MrGadget 2024-10-23 17:51:07 -04:00
parent b39d7bd8d2
commit de2ed26eee

View File

@ -21,8 +21,9 @@ void GenerateTerrain()
Debug.LogError("No Terrain component found on this GameObject."); Debug.LogError("No Terrain component found on this GameObject.");
return; return;
} }
#if UNITY_EDITOR
Undo.RecordObject(terrain, "Generate Perlin Noise Terrain"); Undo.RecordObject(terrain, "Generate Perlin Noise Terrain");
#endif
terrain.terrainData = GenerateTerrainData(terrain.terrainData); terrain.terrainData = GenerateTerrainData(terrain.terrainData);
} }