Page 1 of 1

Database template override bug

Posted: Thu Jul 01, 2021 1:03 am
by Krejwen
Hi,

There is a bug with template tab in database. As far as I can see template tab is shared between projects...

I have two different projects:
1. The main game I am working on
2. Second project to check random stuff e.g. assets integration.

I prepared templates in the first project for my game. In the second project I am checking integration DS with UIS. When I close the second project and open the first one I can see that template settings are the same like for the second one.

Reproduce:
1. Create two different projects in Unity
2. Made some changes in template tab.
3. Close project
4. Open the second project and remove one field
5. Close the second project
6. Open the first project and check that field removed in the second project also was removed here.

Re: Database template override bug

Posted: Thu Jul 01, 2021 9:22 am
by Tony Li
Hi,

This is how templates work:

1. The template is stored in the database. The template of the most recently edited database is also stored in Unity's EditorPrefs. The same EditorPrefs values are shared across all projects.

2. When you open a database in the Dialogue Editor, it checks if a template is stored in the database.
  • If a template is stored in the database, it uses that template, and it sets EditorPrefs to that template.
  • If a template is not stored in the database, it gets the template from EditorPrefs and applies it to the database.
3. When you create a new database, it uses the template stored in EditorPrefs.

4. If you delete a field from a database's template, it will update the template in that database, and it will update EditorPrefs.

5. If you create a new database, the new database will not have the field, since it has been removed from the template in EditorPrefs.

6. However, if you open an old database that had the field, the old database should still have the field. This is because the database's template (containing the field) is stored in the database itself.