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
- URP Realtime reflection probes do not update when RenderProbe() is being called once per second
- Addressable terrain shader variants are stripped from the Player
- [iOS] Debug.Log() appears as <private> in Console app
- UI stays in the background when it is disabled in simulator
- A wrong log file is attached when project is launched with a "-logFile" command line argument
Add comment