Skip to content

Instantly share code, notes, and snippets.

View Eldoir's full-sized avatar
🧠
Love puzzle games.

Arthur Cousseau Eldoir

🧠
Love puzzle games.
View GitHub Profile
@Eldoir
Eldoir / TerrainDataCloner.cs
Last active August 6, 2024 11:32 — forked from zsoi/TerrainDataCloner.cs
Helper to deep-copy a TerrainData object in Unity3D
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