Skip to content

Instantly share code, notes, and snippets.

@inertiave
Last active February 23, 2020 12:21
Show Gist options
  • Save inertiave/ac97846146aa00cf204faad413fe17ce to your computer and use it in GitHub Desktop.
Save inertiave/ac97846146aa00cf204faad413fe17ce to your computer and use it in GitHub Desktop.
여러개의 터레인을 한 번에 편집Edit multi terrains at once by script.
using UnityEngine;
using UnityEditor;
public class EditMultiTerrain
{
[MenuItem("Tools/Multi terrain edit")]
private static void SetDrawInstanced()
{
Terrain[] terrains = Selection.activeGameObject.GetComponentsInChildren<UnityEngine.Terrain>();
foreach (var terrain in terrains)
{
// 여기에서 하고 싶은 작업
terrain.drawInstanced = true;
EditorUtility.SetDirty(terrain);
}
AssetDatabase.SaveAssets();
Debug.Log($"Done. {terrains.Length} items.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment