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
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
- Deleting multiple Tags throws “NullReferenceException”, and "Retrieving array element that was out of bounds" errors when holding the Enter key
Add comment