Description
Support for multithreaded access to the database in readonly mode. No database data should be changed in runtime.
Setup guide
- Import this plugin
- Enable CodeGen addon and generate classes in readonly mode
- Disable LazyLoad addon if it's enabled
- Add Assets\BansheeGz\BGDatabaseReadonlyMT\Scripts\BGDatabaseMTManager.cs script to your startup scene (make sure it's executed before accessing database from multiple threads)
- If you use Addressables and asynchronous assets loading, unpack Assets/BansheeGz/BGDatabaseReadonlyMT/Scripts/AddressablesSupport.unitypackage package
Features
- Initialize data structures, which otherwise are initialized on demand
- Enables L2 memory cache for Unity assets and loads all of them to this cache (make sure that all your assets does not take too much memory)
- Notify code generation utils to use multithreaded approach
Limitations
unityObjectList field is not currently supported
Settings
This component uses 'safety first, optimization second' approach, meaning it's meant to be safe without any additional settings. However, some settings are available to reduce memory usage. Use these settings with big care, cause if the setting rule is broken - it can result in errors.
Parameter | Description |
---|---|
List with all the tables, which 'name' index is used | add all the tables, which can be used for getting an entity by name, otherwise the 'name' index will be initialized for all metas. If you use this setting - make sure to include all the tables, which can be used for getting an entity by name. |
List with all partial keys | add all the keys, which can be used for searching entities by partial key value, for example the key has 2 fields, but entity is searched by 1 single field. If you leave this list empty - all the keys with more than 1 field will be initialized for partial access. If you use this setting - make sure to include all the keys, which can be used for getting an entity by partial key value. |