Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.2.11f1
2018.3.0a1
2019.1.0a1
2019.2.0a1
Issue ID
1106904
Regression
No
Special folders and script compilation order is wrong when compiling Editor scripts
Repro steps:
1. Open the attached "CompilationOrderIssue.zip" project
2. Make sure that Plugins > Editor => "EditorScript" is an Editor script
3. Open the "Test" script
4. Try to reference "EditorScript"
Expected Behavior: "EditorScript" is referenced because it is compiled before "Test" script
Actual Behavior: "EditorScript" is compiled after the "Test" script, therefore it can not be referenced
Reproducible with: 2017.4.18f1, 2018.3.2f1, 2019.1.0a14, 2019.2.0a1
Note: As you can see in the "Test" script - other references work perfectly, so, only scripts in Plugins > Editor are affected. Even when selecting "EditorScript" in the inspector you can see that its assembly file is "Assembly-CSharp-Editor-firstpass.dll". Therefore, it should be compiled in phase 2, before "Test" script, instead of phase 4.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Polyspatial Material swap set animations are not firing when used in Play Mode and Players
- Incomplete shortcuts are displayed in the "Set" dropdown in Visual Effects Graph VFX Control subwindow
- Version change sub-window closes automatically when "Add Modules" subwindow is closed
- RenderTexture content from 'Depth Only' camera is not rendered correctly on UI RawImage when Multithreaded Rendering is enabled on specific MediaTek devices.
- Weight Brush Overlay text is clipped in Sprite Editor
Resolution Note:
So I've looked at your issue, and the compilation order is still respected that is defined in the documentation that you linked to.
What is not properly documented, is how the references are, and I will make an issue regarding this to clarify any confusion with this.
The reason that "Test" can't reference "EditorScript" is that "EditorScript.cs" is in the Editor plugin assembly (Assembly-CSharp-Editor-firstpass.dll), and "Test" are in the Runtime assembly "Assembly-CSharp.dll".
The way that the references are, Editor assemblies references the Runtime assemblies.
So the references are as follows:
Assembly-CSharp-firstpass:
- References only other precompiled assemblies
Assembly-CSharp-Editor-firstpass:
- References other precompiled assemblies
- References Assembly-CSharp-firstpass
Assembly-CSharp:
- References other precompiled assemblies
- References Assembly-CSharp-firstpass
Assembly-CSharp-Editor:
- References other precompiled assemblies
- References Assembly-CSharp-firstpass
- References Assembly-CSharp-Editor-firstpass
- References Assembly-CSharp:
This is also why the compilation is how it is because the referenced assemblies need to be compiled first.