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
- Crash on nvoglv64.dll when opening a project
- [RenderGraph] [CameraStacking] Passes are failing when CameraStacking and RG are enabled
- Physics and Raycast have different behavior when enum is exposed in the Editor
- TextField's text is mixed up and overlapping when "Noto Sans-Display" font is used
- TutorialManager Warnings are thrown when creating Test Track, LEGO or 2D Platform microgame template projects
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.