Helper Class

Module: cc.AssetManager

Provide some helpful function, it is a singleton. All member can be accessed with cc.assetManager.utils

Index

Methods

Details

Methods

decodeUuid

Decode uuid, returns the original uuid

meta description
Returns String
Defined in cocos2d/core/asset-manager/helper.js:42
Parameters
  • base64 String the encoded uuid
Examples
var uuid = 'fcmR3XADNLgJ1ByKhqcC5Z';
var originalUuid = decodeUuid(uuid); // fc991dd7-0033-4b80-9d41-c8a86a702e59
getUuidFromURL

Extract uuid from url

meta description
Returns String
Defined in cocos2d/core/asset-manager/helper.js:62
Parameters
Examples
var url = 'res/import/fc/fc991dd7-0033-4b80-9d41-c8a86a702e59.json';
var uuid = getUuidFromURL(url); // fc991dd7-0033-4b80-9d41-c8a86a702e59
getUrlWithUuid

Transform uuid to url

meta description
Returns string
Defined in cocos2d/core/asset-manager/helper.js:91
Parameters
  • uuid string The uuid of asset
  • options Object Some optional parameters
Examples
var url = getUrlWithUuid('fcmR3XADNLgJ1ByKhqcC5Z', {isNative: false});
isSceneObj

Check if the type of data is cc.Scene or cc.Prefab

meta description
Returns boolean
Defined in cocos2d/core/asset-manager/helper.js:123
Parameters
isScene

Check if the type of asset is scene

meta description
Returns boolean
Defined in cocos2d/core/asset-manager/helper.js:146
Parameters
  • asset Any asset
normalize

Normalize url, strip './' and '/'

meta description
Returns string
Defined in cocos2d/core/asset-manager/helper.js:164
Parameters

results matching ""

    No results matching ""