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
- Non-multisampled texture binding errors are logged when running the DepthBlit URP scene with MSAA enabled on Vulkan
- The Editor does not recognize code errors in generic classes when using C# Source Generator to generate serialization code
- NullReferenceException is logged when undoing Deletion of a Visual Query Block of a Search Expression
- “Unsupported type MinMaxCurve” error and “Could not register property modification for animation binding…” warnings are thrown after moving playhead when Particle System Property is added to Animation window
- Nested LocalizedStrings can not query local variables
Add comment