Cache the ImageAsset with url as key.
The url as key
The image to be cached
Load an image asset with the given url.
The url of the image
Callback for receiving the loaded asset
The callee of the callback function
The ImageAsset, it could be in the loading process, the callback will tell whether the loading process succeed or failed.
Try to load the actual data of the image asset.
The image asset
The callback function after loaded
这里保存所有已经加载的场景资源,防止同一个资源在内存中加载出多份拷贝。
这里用不了WeakMap,在浏览器中所有加载过的资源都只能手工调用 unloadAsset 释放。
参考: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap https://github.com/TooTallNate/node-weak
Gets asset information in runtime environment.
The asset uuid
The result object containing url and raw mark
Return value equals the result
Gets asset information in editor environment asynchronously.
The asset uuid
Callback for retrieving the result
Get the exists asset by uuid.
Gets the url of the asset in library, without extension
The asset uuid
Indicates whether the asset is in raw assets' sub directory
Init the asset library
Load an asset
The uuid of the asset
The callback function once load finished
Load a JSON resource asynchronously
The json content
The callback function after load
parse uuid out of url
资源地址。
资源的 uuid。
Generated using TypeDoc
null or the error info
the created node or null