com.gmonks.assetsyncer
v1.1.0
Published
A Unity library for asset caching, synchronizing and managing assets, designed to streamline asset updates and integration within your Unity projects.
Readme
GMonks AssetSyncer for Unity
A Unity package for efficient asset caching, synchronization, and management across your Unity projects.
Features
- Efficient asset caching and synchronization
- Simple integration with Unity projects
- Reliable and optimized asset management
- JSON-based asset data serialization
Installation
Option 1: Using Unity Package Manager with Scoped Registry
- Open your Unity project.
- Go to Edit > Project Settings > Package Manager > Scoped Registries.
- Click + to add a new scoped registry and enter:
- Name: GMonks
- URL:
https://registry.npmjs.org - Scope(s):
com.gmonks
- Click Save.
- After adding the scoped registry, open the Package Manager.
- Locate
com.gmonks.assetsyncerin the list, select it, and choose the desired version to install. - Click Install.
Option 2: Modify manifest.json Directly
- Open your project folder and navigate to
Packages/manifest.json. - Add or update the
scopedRegistriessection:"scopedRegistries": [ { "name": "GMonks", "url": "https://registry.npmjs.org", "scopes": [ "com.gmonks" ] } ], - Add the package to the
dependenciessection:
Replace"com.gmonks.assetsyncer": "x.y.z"x.y.zwith the specific version you want to install, as listed in the package registry or release notes - Save the file and return to Unity. The package will be installed automatically.
Usage
1. Initialize AssetSyncer
AssetSyncer must be initialized with a CryptoConfig instance containing your secretKey and pepper.
This is required for secure asset caching and encryption.
using GMonks.AssetSyncerLib;
using GMonks.Utilities.Crypto;
void Start()
{
var cryptoConfig = new CryptoConfig(secretKey: "YOUR_SECRET_KEY", pepper: "YOUR_PEPPER");
AssetSyncer.Initialize(cryptoConfig);
}2. Request an Asset
using GMonks.AssetSyncerLib;
using GMonks.AssetSyncerLib.Data;
var assetQuery = new AssetQuery(
groupId: "MyGroup",
assetId: "example_asset",
extension: AssetExtension.PNG,
assetUrl: new AssetUrl("https://example.com/assets/example_asset.png"),
updateTime: 1234567890,
extras: "",
callback: asset => {
if (asset != null) {
Debug.Log("Asset loaded: " + asset.NameWithExtension);
} else {
Debug.LogError("Failed to load asset.");
}
}
);
AssetSyncer.GetAsset(assetQuery);3. Remove an Asset
AssetSyncer.RemoveAsset("MyGroup", "example_asset");4. Remove an Entire Asset Group
AssetSyncer.RemoveGroup("MyGroup");API Reference
AssetSyncer: Main entry point for asset caching and synchronization.AssetQuery: Query for requesting and downloading assets.Asset: Represents a cached asset.AssetGroup: Represents a group of assets.
Support
This package is maintained by GMonks Entertainment Private Limited.
For support, please contact the package maintainer directly.
© 2014-2025 GMonks Entertainment Pvt. Ltd. All Rights Reserved.
