Last active
February 23, 2020 12:21
-
-
Save inertiave/ac97846146aa00cf204faad413fe17ce to your computer and use it in GitHub Desktop.
여러개의 터레인을 한 번에 편집Edit multi terrains at once by script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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