{"__v":12,"_id":"54890948f291f61400c02d40","category":{"__v":5,"_id":"54890902f291f61400c02d3e","project":"543b9b0065bf840e00b473d5","version":"543b9b0065bf840e00b473d8","pages":["54890948f291f61400c02d40","54895ef66a600c0b0051ae23","54895f836a600c0b0051ae25","5530ab364c0c6d0d00bae463","55d300c7486de50d00327221"],"reference":false,"createdAt":"2014-12-11T03:01:22.975Z","from_sync":false,"order":8,"slug":"troubleshooting","title":"Troubleshooting"},"project":"543b9b0065bf840e00b473d5","user":"543b9aa865bf840e00b473d1","version":{"__v":11,"_id":"543b9b0065bf840e00b473d8","project":"543b9b0065bf840e00b473d5","createdAt":"2014-10-13T09:27:28.467Z","releaseDate":"2014-10-13T09:27:28.467Z","categories":["543b9b0065bf840e00b473d9","543b9ef065bf840e00b473e0","54890012f291f61400c02d36","54890902f291f61400c02d3e","54890c43f291f61400c02d44","54890d71c178b40b00aa3086","5508125c0c4d8c19008a5f83","55094050961f17170070abbd","550945111c38c50d006118ad","550a4c2e42fff40d00ae6049","55221c074801a40d00a77610"],"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2014-12-11T03:02:32.405Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"try":true,"auth":"never","params":[],"url":""},"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Error CS0246 - UILabel, UIProgressBar, UI etc.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Assets/Scripts/Buildings/BuildingCreator.cs(17,16): \\nError CS0246: The type or namespace name 'UILabel' could not be found. Are you missing a using directive or an assembly reference?\",\n      \"language\": \"cplusplus\",\n      \"name\": \"Error Message\"\n    }\n  ]\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Assets/Scripts/Stats.cs(14,16): \\nError CS0246: The type or namespace name 'UIProgressBar' could not be found. Are you missing a using directive or an assembly reference?\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\n**Troubleshooting:**\n\n1. UILabel errors mean something is wrong with your import of NGUI or 2D Toolkit. Check that you're using the most recent paid version of NGUI (**version 3.6.8 or above**). The free version of NGUI (version 2.7.0) is outdated and will give you these UILabel errors. Read the installation section again.\n\n2.  If you're running the most recent paid version of NGUI, as per NGUI's team instructions start with a fresh copy of the Starter Kit and import NGUI in a new empty scene, not directly in Game scene (throws a few internal NGUI errors if you import into the Game.unity scene). \n\n3. Safer to apply this to 2DToolKit as well, and import 2D Toolkit into a new empty scene of a fresh starter kit copy as well.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"All Other Errors\"\n}\n[/block]\nOur kits include up to 57 Unity C# scripts controlling every aspect of the gameplay. It's possible that during your use you changed a setting. If you've encountered an error code we haven't listed here, please follow these steps:\n\n**Troubleshooting:**\n\nFirst, download a fresh copy of your kit, import both NGUI and 2D Toolkit again. Run the Game.unity scene to test that the original copy works as expected in your development environment. Does the fresh copy of the kit work?\n\n**Yes, it runs:** - If the fresh copy runs, retrace the changes you've made recently. Replace the scripts you've edited with original copies, one-by-one to identify the specific issue. **Tip:** We recommend saving daily backups of the source code so you have a recent copy of each script to cross-check.\n\n**No, it doesn't run:** - If this doesn't work, update your copies of NGUI and 2D Toolkit to the most recent paid asset versions and follow the Getting Started page in the documentation. If this continues to not work, please send a screenshot of your setup and the specific error codes you're receiving to help (at) citybuildingkit.com\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"The catch-all fix for most errors we've come across is to download the original kit again and replace the scripts you've edited one-by-one to troubleshoot where the exact problem is.\\n\\nTo prevent future problems, always keep a backup of every script - daily backups preferably - so that if a problem occurs, you can revert to the most recent save.\",\n  \"title\": \"Still Having Problems?\"\n}\n[/block]","excerpt":"Updated list of the most common compiler errors developers experience. A short list is a good list. :)","slug":"build-errors","type":"basic","title":"Unity Compiler Errors"}

Unity Compiler Errors

Updated list of the most common compiler errors developers experience. A short list is a good list. :)

[block:api-header] { "type": "basic", "title": "Error CS0246 - UILabel, UIProgressBar, UI etc." } [/block] [block:code] { "codes": [ { "code": "Assets/Scripts/Buildings/BuildingCreator.cs(17,16): \nError CS0246: The type or namespace name 'UILabel' could not be found. Are you missing a using directive or an assembly reference?", "language": "cplusplus", "name": "Error Message" } ] } [/block] [block:code] { "codes": [ { "code": "Assets/Scripts/Stats.cs(14,16): \nError CS0246: The type or namespace name 'UIProgressBar' could not be found. Are you missing a using directive or an assembly reference?", "language": "cplusplus" } ] } [/block] **Troubleshooting:** 1. UILabel errors mean something is wrong with your import of NGUI or 2D Toolkit. Check that you're using the most recent paid version of NGUI (**version 3.6.8 or above**). The free version of NGUI (version 2.7.0) is outdated and will give you these UILabel errors. Read the installation section again. 2. If you're running the most recent paid version of NGUI, as per NGUI's team instructions start with a fresh copy of the Starter Kit and import NGUI in a new empty scene, not directly in Game scene (throws a few internal NGUI errors if you import into the Game.unity scene). 3. Safer to apply this to 2DToolKit as well, and import 2D Toolkit into a new empty scene of a fresh starter kit copy as well. [block:api-header] { "type": "basic", "title": "All Other Errors" } [/block] Our kits include up to 57 Unity C# scripts controlling every aspect of the gameplay. It's possible that during your use you changed a setting. If you've encountered an error code we haven't listed here, please follow these steps: **Troubleshooting:** First, download a fresh copy of your kit, import both NGUI and 2D Toolkit again. Run the Game.unity scene to test that the original copy works as expected in your development environment. Does the fresh copy of the kit work? **Yes, it runs:** - If the fresh copy runs, retrace the changes you've made recently. Replace the scripts you've edited with original copies, one-by-one to identify the specific issue. **Tip:** We recommend saving daily backups of the source code so you have a recent copy of each script to cross-check. **No, it doesn't run:** - If this doesn't work, update your copies of NGUI and 2D Toolkit to the most recent paid asset versions and follow the Getting Started page in the documentation. If this continues to not work, please send a screenshot of your setup and the specific error codes you're receiving to help (at) citybuildingkit.com [block:callout] { "type": "danger", "body": "The catch-all fix for most errors we've come across is to download the original kit again and replace the scripts you've edited one-by-one to troubleshoot where the exact problem is.\n\nTo prevent future problems, always keep a backup of every script - daily backups preferably - so that if a problem occurs, you can revert to the most recent save.", "title": "Still Having Problems?" } [/block]