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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
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.