Search Issue Tracker
Fixed in 2017.2.0f3
Votes
0
Found in
2017.1.0f1
Issue ID
923749
Regression
Yes
All scripts in project are dropped from objects after error on compilation of Player
All scripts in project are dropped from objects after error on compilation of Player
1. Open project attached.
Or
1. Create an object and attach to it 2 scripts:
- First script attached to Cube "using UnityEditor",
- Second script in simple empty script.
2. Press Run - project compiles fine.
3. Build & Run.
4. Errors on compilation appear:
Assets/SemiEditorScript.cs(4,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?
Error building Player because scripts had compiler errors
UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options)
5. Return to Unity. Press Play in Editor.
Actual result: You enter the playmode. However you get "The referenced script on this Behaviour is missing!" errors and scripts are not shown in object.
To fix this just edit/save any script, and project will build in Editor.
Expected result: In 5.6 project with incorrectly used "using UnityEditor" script did not compile after point 5, but all other scripts are attached to object and compile fine.
Reproduces in 2017.1.0f1, 2017.2.0b1.
Does not reproduce in 5.6.1p1.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android] Stage information is not logged when Log Shader Compilation is enabled
- [Vulkan] The memory allocation increases rapidly when there are multiple (three or more) Real-Time Reflection Probes in the Scene
- [macOS] Library folder of the opened project can be deleted which leads to the crash
- “Default Scene” dropdown field contains a spelling mistake “Default Builtin”
- Editor crashes on PPtr<Mesh> after adding Text Mesh and Cloth Components to the same GameObject
Add comment