Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Sparkster · May 13, 2011 at 03:07 AM · errorcompiler-error

"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");

}

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Eric5h5 · May 13, 2011 at 03:13 AM 1
Share

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.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CHPedersen · May 13, 2011 at 07:00 AM 2
Share

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.

avatar image Dreamer · May 13, 2011 at 07:28 AM 0
Share

So I guess you are using C#? Can it support Javascript?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges