Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Dynamic Resource

About

DynamicResource is a Component that implements resource declaration manifest that registers it within DDM sub-systems as resource.

The component has integration with Tags Tool module that allows to define runtime tags to the resource. That allows categorization of such resources to fact access at runtime.

Using

Creation

For creation of a new Dynamic Resource within a project you need to follow a few simple steps.

  1. Create a Resources folder in the Project window. The folder will make the resources located inside visible to search engine.
  2. Create new GameObject using Hierarchy window that will be used as resource or select exists object that you want to turn to DynamicResource.
  3. In the Inspector window press Add component button and navigate by following directory in drop-down list
    Doloro GDK / Doloro Data Management / Dynamic Resource

The component has been added to the object.

New Dynamic Resource component

After finishing the adjustment of the game object to a state as you what to distribute it,
drag and drop the game object from the Hierarchy window to Resources folder created at the first step.

Signature

Signature is a most important part of the Dynamic Resource. It works like a personal access address leading toward resource instance.

Field Tooltip
Bundle Works similar to namespace and allows to allocate resources with the similar case at the same project without conflicts.
Key Key of the resource itself to direct access via the DynamicResourcesDatabase.

In common case the signature should be unique for each resource, but the system does not prevent names collision. Some systems like a Merge Tool or Patch Tool managing resources with the same signatures as a part of whole, that allows to supply certain resource with new features / objects or modify them along with scripts.

See also: Doloro.DataManagement.DynamicResources.DynamicResourcesDatabase

Version

Version of the resource allows to determine is the faced version is more relevant than other.

You may set a version. For this:

  1. Click the version label.
  2. Enter new version in appeared text field following the next rules:
    1. Version parts must be divided with the . symbol.
    2. Letter modifier can be added after all digit data.
  3. Press Confirm button to apply changes.

Tags

By pressing + button into intermediate GUI zone you cad defied tags applicable to the resource.
That will allow you to categorize the resource within internal data base and use it at any custom system using tags in its logic.

To remove tag from the resource just click over it.

More about Tags using you can find at Tags Tool category.


Custom resource

During development you may face requirements to create a custom class derived from the DynamicResoruce.
DDM do not interferes with this. Any internal data base will work with such resource without any issues.

Runtime

To create a runtime part of custom dynamic resource you just need to create a new script by following pattern.

using Doloro.DataManagement.DynamicResources;
public class CUSTOM_D_RESOURCE_CLASS : DynamicResource
{
// Define your custom logic here
}

Where CUSTOM_D_RESOURCE_CLASS is a name of your class and source file.

Editor

If you want to re-use default DynamicResoruce editor inspector, you need to create a custom editor script following next pattern.

using UnityEditor;
// Bonding you editor class with runtime class.
[CustomEditor(typeof(CUSTOM_D_RESOURCE_CLASS))]
public class CUSTOM_D_RESOURCE_CLASS_Editor :
// Deriving class from DR default editor.
DataManagement.DynamicResources.DynamicResourceEditor
{
// Overriding GUI handler.
public override void OnInspectorGUI()
{
// Calling defult inspector.
base.OnInspectorGUI();
GUILayout.Space(10);
}
}
Warning
The script must be located at an Editor folder.