Skip to content

Overriden collection values in prefab components are lost upon reloading an assembly defining that component #2716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Eideren opened this issue Apr 18, 2025 · 0 comments · May be fixed by #2718
Labels
area-GameStudio bug Something isn't working

Comments

@Eideren
Copy link
Collaborator

Eideren commented Apr 18, 2025

Release Type: Git

Version: Latest

Platform(s): Windows editor

Describe the bug
Let's say you have a collection defined on one of your component:

public class MyComponent : StartupScript
{
    public List<string> MyStrings { get; set; } = new();
}

You then

  1. Put that component in a prefab
  2. Add that prefab to a scene
  3. And add in a string to the MyStrings collection on that prefab in the scene.

The yaml for the component in that scene would look something like so:

MyStrings:
    0a0000000a0000000a0000000a000000*: MyDerivedString

Notice the override marker (*) at the end of the Id for that item.
Now, make any change to your source and reload the editor, the next time you save, the collection would be empty in the scene;

MyStrings: { }

To Reproduce
See above.

Expected behavior
Reloads without loss of data.

Additional context
I'm currently working on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-GameStudio bug Something isn't working
Projects
None yet
1 participant