Skip to main content
Version: v3

PatchSettings

Important Attention Reminder

Coding Style wiki


PatchSettings is the patch settings class (ScriptableObject) of AssetLoader. It centralizes global settings related to hot updates and asset packages — config file names, extensions, the cipher key, and output folder names — and is accessed at runtime through the static settings property.

NamespaceOxGFrame.AssetLoader
Typepublic class (inherits ScriptableObject)
SourcePatchSettings.cs
using OxGFrame.AssetLoader;

Reminder A custom PatchSettings.asset can be created via the editor menu Assets → Create → OxGFrame → Create Settings → Create Patch Settings in Resources (it is created inside a Resources subfolder of the selected folder automatically); without the asset, the default values are used.

Properties

settings

public static PatchSettings settings { get; }

Returns

PatchSettings — the global settings instance (singleton).

Description

Gets the global settings instance. On first access, it loads the asset named PatchSettings from Resources; if the asset is not found, an instance with default values is created automatically (a log indicates that default settings are used).

Example

// Compose the full APP config file name (AppInfo.json by default)
string appCfgFileName = $"{PatchSettings.settings.appCfgName}{PatchSettings.settings.appCfgExtension}";

Fields

App Config Settings

NameTypeDefaultDescription
appCfgNamestring"AppInfo"File name of the APP config.
appCfgExtensionstring".json"File extension of the APP config.

Patch Config Settings

NameTypeDefaultDescription
patchCfgNamestring"PatchInfo"File name of the patch config.
patchCfgExtensionstring".json"File extension of the patch config.

Bundle URL Config Settings

NameTypeDefaultDescription
bundleUrlCfgCipherbyte(not disclosed)XOR cipher key of the deployment config (bundle request endpoints), used together with the CIPHER_HEADER file header.
bundleUrlCfgNamestring"CdnConfig"File name of the deployment config (bundle request endpoints).
bundleUrlCfgExtensionstring".dat"File extension of the deployment config (bundle request endpoints).

Folder Settings

NameTypeDefaultDescription
rootFolderNamestring"CDN"Root folder name of the CDN output.
dlcFolderNamestring"DLC"Subfolder name where DLC packages are stored.

Attention Extension fields must include the dot (e.g., .dat, .cfg, .json).

Constants

ConstantTypeValueDescription
CIPHER_HEADERshort(not disclosed)Cipher header mark of encrypted config files. The 2-byte header is written when the deployment config is encrypted, and detected on read to decide whether decryption is needed.
META_FILE_EXTENSIONstring".meta"META file extension.
APP_CFG_BAK_EXTENSIONstring".bak"Backup extension of the APP config.
PATCH_CFG_BAK_EXTENSIONstring".bak"Backup extension of the patch config.
BUNDLE_IPstring"bundle_ip"Key name of the bundle request endpoint in the deployment config.
BUNDLE_FALLBACK_IPstring"bundle_fallback_ip"Key name of the fallback bundle request endpoint in the deployment config.
STORE_LINKstring"store_link"Key name of the store link in the deployment config.

Reminder BUNDLE_IP, BUNDLE_FALLBACK_IP, and STORE_LINK can be used as key parameters for BundleConfig.GetValueFromUrlCfg.