Doloro GDK 22 .1.0 Beta
by Tauri Interactive
API

Categorized Tags Database

The static API that provides you control over cached collection of resources.
Explore API: Doloro.DataManagement.DynamicResources.Modules.TagsTool.CategorizedTagsDatabase

Warning
Before getting access to resources collections from cache, the cache must be loaded.
You may do it:
  • manually via API member
    1. CategorizedTagsDatabase.CategorizeCacheableDynamicResources
    2. CategorizedTagsDatabase.CategorizeCacheablePrefabAssets
    3. CategorizedTagsDatabase.CategorizeCacheableAssets
  • automtically via Asset Bundles Tools integration. More about: ABT Integration


Backstage process tracking

As soon as the backstage processes going under the database hood is asynchronically at takes a time (depends on a size of resources catalog) you may find it useful to track the stage database currently on.

For this you should use following members of CategorizedTagsDatabase:

Member Description
CategorizationState Provides precise step of categorization process.
CategorizationInprogress Indicates is the database currently under processing and can't be accessed.
CategorizationProcessLog Provides you with backstage logs that can be used to visualize loading state.

Also you may find useful following next events:

Event Occasion
onCategorizationFinished Occurs when the CategorizationProcessLog value has been updated.
onCategorizationFinished Occurs when categorization process is finished.


Cached resources access

When catagoriazation has been finished you can access collection of objects related to tags with enabled caching.
For this you need to use one of the following API method:

Member Operation
GetResources(params Tag[] tags) Return intersection of cashed resources those have entire tags as defined.
At leas one of the tag must has isCached property as one,
otherwise an output collection will be empty.
GetResources(Tag tag) Searching resources for a certain cached Tag.
GetResources(string tagKey) Searching resources for a certain cached Tag by its key.

All of the methods return ICollection<UnityEngine.Object> as result, where object is a resources derived from UnityEngine.Object and implemented ITagsCollection interface.
*DynamicResources instances at common cases, but could be different in case of custom solutions provided with your source or modules providers.


Tags Database Utils

The static API class that allows to handle backstage operations with project located Tags Database assets.

Explore API:

Warning
Before using the API TagsDatabase assets have to be loaded.
You may handle this task by one of the following ways:
  • (Runtime only) If you are addressing API via completely loaded Categorized Tags Database you no need to do anything. CTD API loads TDU during its internal initialization operations.
  • (Editor & Runtime) Follow manual initialization instructions provided at Important to know section.


Merged database

All the main internal systems of framework use as tags provider a merged copy of entire TagsDatabase assets found within the project.
That access provided via the TagsDatabaseUtils.MergedDatabase property.
Read more about databases merge process: Merge

Reflection update

The merged database by itself is a static database the not following updates of sources used within.
In case you need to update this reflection due to some changes in origin, you have to call the database drop via TagsDatabaseUtils.DropMergedDatabase() handler.

After this, during a next call of TagsDatabaseUtils.MergedDatabase property the system will build a new reflection according with the relevant sources.

The merged database automatically drops in case of creating a new database or Reload call.


Important to know

To use the data base has to be loaded.
You may indicate the state using TagsDatabaseUtils.IsLoaded property.

In case if it isn't loaded you have to request its load using the TagsDatabaseUtils.Reload method.
You may get notified about loading finish by signing up on the TagsDatabaseUtils.onLoaded event.

Example

Following example shows safe way of database access.

// Checking that the database has been loaded.
if(TagsDatabaseUtils.IsLoaded)
{
// Executing our database handler.
DatabaseOperator();
}
else
{
// If the loading process has not been started yet.
if(!TagsDatabaseUtils.IsLoading)
{
// Requesting data base reload.
TagsDatabaseUtils.Reload();
// Signing up our handler on loading related events.
TagsDatabaseUtils.onLoaded += DatabaseOperator;
}
else
{
// Data base during loading we can resign up
// on events in case we not sure we have been signed up yet.
TagsDatabaseUtils.onLoaded -= DatabaseOperator;
TagsDatabaseUtils.onLoaded += DatabaseOperator;
}
}
// Custom handler that should operate the database content
// when it's available to access.
void DatabaseOperator()
{
// Releasing handler from the event system.
TagsDatabaseUtils.onLoaded -= DatabaseOperator;
// -----------------------
// Do your operation here.
// -----------------------
}