Keep Prefab Link Issue

Hello there,

I have decided to start using the prefab link for some things like tabs and buttons, and I noticed that sometimes the edits made in the UI designer are not being saved when going into play mode. An example of this for me is when you create Inventory Grid Tabs, then rename those grid tabs from the UI designer. When using prefab links, it seems to forget the edits when hitting play and sets it back to default. I can manually get around this by changing the name in the inspector but I do fear that maybe some other edits made with UI designer are possibly not getting saved as well? I suspect that maybe the prefab needs to be SetDirty to remember the change?

Thanks!
 
I'm not sure what you are refering to, could you give me a specific example, with perhaps some screenshots/videio?

The UI Designer is simply an Editor tool that spawns things in the scene to help you speed up the UI creation. Once the game starts the UI Designer doesn't affect anything. At that point the components in your scene are the ones that do all the heavy lifting.

In some cases those components will dynamically replace certain elements.

For example the InventoryGrid will usually dynamically replace the ItemViews at runtime. This allows you to define different ItemViews depending on the Item being showed.
 
No problem, happy to make a video for you. Here it is in UIS 1.2.6: https://streamable.com/o5nvnt

When turning on prefab link, then generating prefab tabs and editing those tabs through the visual editor, you'll see that any edits make to those prefabs are gone as soon as the play button is hit.

This isn't a big priority for me as there are work arounds, just wanted to show you the issue :)
 
Could you try adding the following line, at line 434 of the InventoryGridDesigner.cs file:
Code:
Shared.Editor.Utility.EditorUtility.SetDirty(selectedTab);

Let me know if that fixes it.
 
It looks like that just sets the selected tab gameobject itself to dirty but not the Name GameObject for the textmeshpro asset. Maybe there needs to a script on TabToggle.cs that sets the TMP asset to dirty?
 
Lets give this a try:

Code:
Shared.Editor.Utility.EditorUtility.SetDirty(selectedTab);
Shared.Editor.Utility.EditorUtility.SetDirty(selectedTab.gameObject);

If that doesn't work than it will require some changes to the Text abstraction which would require more work.
 
Thanks! I tried it out and unfortunately it didn't work. I was thinking of adding a method into the TabToggle script that can handle setting changed elements to dirty. I can definitely work around this issue though, it isn't a big road block for me, but I can definitely continue debugging if you want me to try anything!
 
Top