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
- After converting a Built-in project to URP render texture setting error message is spammed
- UI Builder slider value lags and stutters when sliding/modifying certain property values
- "Reset UI Builder Layout" functionality inconsistently changes Canva Size when "Match Game View" is enabled/disabled
- Texture Import Warnings are obscured by other Terrain Layer options in the Inspector
- Burst Inspector middle divider is jittering when resized with the Burst Inspector window docked
Add comment