Open Basewq opened 5 months ago
This also happens with the First Person Template.
I traced the exception to AssetCollectionViewModel.cs - Line 542 ExceptionError: Index out of range for directory.Package.Package.ResourceFolders[0]
It seems like it should be relatively easy to fix, but I wasn't able to understand where the code sets the resource folder directories. Following the code path of the package class ended up being more complicated than I expected....
I remember fixing all templates a while back. Wasn't it included in the latest release of Stride?
edit: it was fixed in #2109, and should be present from version 4.2.0.2121
onwards.
With that said, we should add a prompt to ask for a location if it's unset. Let's track that in this issue.
Unless I've messed around too much will my machine, I tried the RPG template with 4.2.0.2188 and the sdpkg still has ResourceFolders: []
My vague understanding is this would need to be updated since it's still pointing to the older sample 4.2.0.1
?
https://github.com/stride3d/stride/blob/237e8605e4b36337b8dca92d2338b1086547616a/sources/editor/Stride.Samples.Templates/ThisPackageVersion.PackageBuild.cs#L7
Oddly enough, the .cs
code changes to use top level statements does come through (I guess there's some additional upgrading steps the editor understands?)
@Basewq good point.
Release Type: Official Release
Version: 4.1.0.1948+
Platform(s): Editor
Describe the bug Adding a raw asset within the project solution and importing the asset warns importing assets are not inside resource folder when there is no ResourceFolders declared in the
.sdpkg
file. Hitting Ok also prompts if you want to copy the asset in the resource folder. Hitting Ok here will crash the editor.The 'New game' template is one of the rare project templates that explicitly declare the resource folder in the
.sdpkg
file:Other templates, eg TopDown RPG do not:
Futhermore, it places the Resource folder (and Asset folder) one level above the game project folder.
To Reproduce Steps to reproduce the behavior:
Expected behavior Handle the special case where package's Resource folder(s) are not explicitly declared.
Additional context Original feature introduced #1781 Copy raw asset into resource folder feature added here #1827