- Home /
"All compiler errors have to be fixed before you can enter playmode!"
I looked around on a few threads but all people said were "open the error in the console and fix it".... wtf... that's not enough info. i don't know what to fix. here's the problems.
Here's the first one:
@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");
}
And the second is,
@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");
}
Click on the error in the console. It says what the error is and where it is in the script. Just pasting the script here isn't very helpful.
Answer by Dreamer · May 13, 2011 at 03:24 AM
You can usually find the error messages in "Console" window and double click the message will automatically point the line in script that cause the problem. You need to use in-built script editor, I am not sure if that works for other script editors.
If you can't find "Console" window, you can add it by clicking the reserved triangle button on screen. (there are 3 small lines behind it if I am not wrong)
Just as an added bonus, doubleclicking error messages in the error console actually also works for external editors. :) It jumps to the problematic line in Visual Studio 2010 for me, at least.
Your answer
Follow this Question
Related Questions
all compiler errors 1 Answer
How do I fix compliance error? 1 Answer
Example Projects do not Compile in Unity 3.0 2 Answers
Internal compiler error 0 Answers
Error building Player: Extracting referenced dlls failed. 8 Answers