Doloro GDK 22 .1.0 Beta
by Tauri Interactive
Patch Tool

About

Patch tool has been created to provide you with a fast, effective and simple way to fix \ modify \ upgrade a resources at post-release stage without redistributing of huge packages from scratch.
The tool focused on suppling patches with a small AssetBundle packages focused precisely on solving patch task.

More in this category:


How does it work

Patch tool uses both Dynamic Resources Database (DRD) logic and Merge Tool features to operate resource patches.

This works under following pipeline:

  1. DRD loads DynamicResource located at project packages.
  2. DRD merges colliding resources to a single instance.
  3. Patch Tool executes patches appeared in merged resources along with its order.

Development

Patches by itself demands only a runtime logic part, but the module also provides you with uniformed Editor controller that can be used in case you want to create a standardized UI for patch in-editor representation.

Runtime part

To create a runtime part of patch you need to:

  1. Create a new class derived from APatchOrder.
  2. Implement the logic of the patch within overridden Patch(GameObject obj) handler.
  3. Create an empty game object on a scene. The object will be used as distributable patch in future.
  4. Add your created patch script as component to the game object.
  5. Define signature of patch destination resource at the auto created Dynamic Resource component.
  6. Configure the patch via its component is required.

Now you have a distributable runtime patch object that can be prepared to Distibution process.

Runtime part

Following example demonstrates template of patch runtime part.

using UnityEngine;
using Doloro.DataManagement.DynamicResources.Modules.PatchTool;
public class YourPatchOrder : APatchOrder
{
/// <summary>
/// Handler where you have to define patch logic over patching game object.
/// </summary>
/// <param name="obj">Target object that receives the patch.</param>
public override void Patch(GameObject obj)
{
// HERE Define your patch logic that will be applied to the
// Game Object considered by backstage services as a
// destination of the patch.
}
}

where YourPatchOrder is a name of class and source file of your patch.

See also:


Editor part

Warning
The editor part script MUST be located within Editor folder to be excluded from a runtime build.

To create a editor part with uniformed patch related editor:

  1. Create a new script.
  2. Locate it in Editor folder.
  3. Derive the class from the APatchOrderEditor class.
  4. Define CustomEditor forwarding to your runtime part class.
  5. (Optional) If you have public members to display:
    1. Override OnInspectorGUI method.
    2. Call base.OnInspectorGUI() to draw uniform GUI.
    3. Implement your custom GUI.

Example

Following example demonstrates template of patch editor part.

using UnityEditor;
using Doloro.DataManagement.DynamicResources.Modules.PatchTool;
[CustomEditor(typeof(YourPatchOrder))]
public class YourPatchOrderEditor : APatchOrderEditor
{
public override void OnInspectorGUI()
{
// Call uniform GUI.
base.OnInspectorGUI();
// Define your custom GUI
// or call DrawDefaultInspector().
}
}

See also:


Configuration

To configurate yearly created patch to Distibution process follow next steps:

  1. Create an empty game object on a scene. The object will be used as distributable patch in future.
  2. Add your patch script(s) as component to the game object.
  3. Define signature of patch destination resource at the auto created Dynamic Resource component.
  4. Configure the patch(es) via its component is required.
  5. Create Resources folder into the project.
  6. Drag and drop the object from a scene to the Project window to resources folder.

The patch resource ready to be distributed using Asset Bundles Tools.


Distibution

To destribute patch resource object created at previous steps we need to build it to AssetBundle package. For this:

  1. At the Inspector window select created prefab object.
  2. At the Inspector's footer click on Asset Labels line to open configuration GUI.
  3. Define new Asset Bundle for the resource.
  4. At the top menu of editor window select
    Doloro GDK / Build asset bundles.
  5. Set destination folder and confirm build.
Warning
At some platforms of package versions Doloro GDK category can be sub-category of the Tools category.

Asset bundle at the destination folder contains the patch resource.
Now the bundle has to be delivered to the client ad loaded to the game via Asset Bundles Tools.