Skip to content

Instantly share code, notes, and snippets.

@PixHammer
PixHammer / TerrainDataCloner.cs
Last active March 7, 2024 23:07 — forked from Eldoir/TerrainDataCloner.cs
Helper to deep-copy a TerrainData object in Unity3D - Updated for Unity 2021.2
using UnityEngine;
/// <summary>
/// Provides means to deep-copy a TerrainData object because Unitys' built-in "Instantiate" method
/// will miss some things and the resulting copy still shares data with the original.
/// </summary>
public class TerrainDataCloner {
/// <summary>
/// Creates a real deep-copy of a TerrainData
/// </summary>