Search Issue Tracker
Third Party Issue
Votes
0
Found in
2019.4
2020.3
2021.1
2021.2
2022.1
2022.1.0a11
Issue ID
1370747
Regression
No
Local Package project files are generated incorrectly when the Package is added by relative file path
How to reproduce:
1. Open the project in the attached folder (RelativePackageTest.zip)
2. In the Project view, go to Packages/Graphics Tests Framework/Runtime and open "GraphicsTestCase.cs"
3. Add the #define directive line "#if UNITY_EDITOR" as the first line of the script and save
4. In the Project view, go to the Assets folder and open "ScriptOutsidePackage.cs"
5. Add the #define directive line "#if UNITY_EDITOR" as the first line of the script and save
6. Go to the Editor and observe the Console
Expected result: the #define directive is available for both scripts, two "#endif directive expected" errors are thrown for both of the scripts
Actual result: the #define directive is not available for the script in the Package, only one "error CS1027: #endif directive expected" is thrown for ScriptOutsidePackage.cs
Reproducible with: 2019.4.31f1, 2020.3.20f1, 2021.1.25f1, 2021.2.0b16, 2022.1.0a12
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:
The issue comes from Player projects being generated and the user has to pick up the right context in rider to show the code as if compiled for editor.