It’s for the Island Demo on unity, I’d like to get it working but I keep getting these errors and I know some Javascript but all in all I’m rather inexperienced.
Here’s my code.
@MenuItem("Terrain/Update Tree Lightmap Color")
static function RebuildWithLightmap () {
var tex : Texture2D = Selection.activeObject as Texture2D;
if (tex)
{
if (Terrain.activeTerrain == null || Terrain.activeTerrain.terrainData == null)
{
EditorUtility.DisplayDialog("No active terrain in the scene", "No active terrain in the scene", "Ok");
return;
}
Undo.RegisterUndo(Terrain.activeTerrain.terrainData, "Set Tree colors");
UnityEditor.TerrainLightmapper.UpdateTreeLightmapColor(tex, Terrain.activeTerrain.terrainData);
}
else
EditorUtility.DisplayDialog("Select a lightmap", "Select a lightmap", "Ok");
}
@MenuItem("Terrain/Update Tree Color")
static function RebuildWithColor () {
var tex : Texture2D = Selection.activeObject as Texture2D;
if (tex)
{
if (Terrain.activeTerrain == null || Terrain.activeTerrain.terrainData == null)
{
EditorUtility.DisplayDialog("No active terrain in the scene", "No active terrain in the scene", "Ok");
return;
}
Undo.RegisterUndo(Terrain.activeTerrain.terrainData, "Set Tree colors");
UnityEditor.TerrainLightmapper.UpdateTreeColor(tex, Terrain.activeTerrain.terrainData);
}
else
EditorUtility.DisplayDialog("Select a lightmap", "Select a lightmap", "Ok");
}
So if anyone can help that’d be great. It says it’s on this line:
UnityEditor.TerrainLightmapper.UpdateTreeLightmapColor(tex, Terrain.activeTerrain.terrainData);
Thanks!