Moved/renamed Assets dont update UrlReference references
Release Type: Official Release
Version: 4.2.2381
Platform(s): Windows
Describe the bug When you have an asset in the asset explorer that is referenced in a scene. Moving or renaming that asset will not update those references in the build.
To Reproduce Steps to reproduce the behavior:
- Create a basic project
- reference the GameSettings Asset in a component using a
UrlReference - use
Content.Loadin that component script(just for seeing the error) - when the asset is moved and the projects is rebuilt and run see the asset at the previous location
Expected behavior references should be updated automatically.
Additional context In the editor the reference Url does get updated but it just doesnt show in the actual build causing it to not be noticeable until you run the game.
public class TestComponent : StartupScript
{
public UrlReference<GameSettings> Item { get; set; }
public override void Start()
{
var item = Content.Load(Item);
}
}
The issue seems to be coming from AssetDependancyManager just missing the feature to update Assets that also reference a changed asset in Session_AssetDirtyChanged line 516
Although I dont understand why the Game Studio doesnt show that the asset hasnt moved? If the field in Game Studio shows the change shouldnt that update on save as well?
It seems like this error is new to the most recent release due to https://github.com/stride3d/stride/pull/2528. I think I understand the error that was fixed and I dont think we need to revert it but maybe we can get a list of assets to update based on the LinksOut of an Asset being tracked? I think doing that in the referenced method above could be a solution?