异步方式获取配置里的资源。只要是配置文件里存在的资源,都可以通过异步方式获取。
对应配置文件里的 name 属性或 sbuKeys 属性的一项。
回调函数。示例:compFunc(data,key):void。
回调函数的 this 引用。
#setMaxRetryTimes
以下代码演示了如何通过getResAsync加载资源<pre> RES.getResAsync("resource/example.json");//只传入key值获取资源 RES.getResAsync("resource/example.json", (data) => { console.log(data) }, this) //传入key值,compFunc和thisObject获取资源,后两个必须同时出现</pre> Copy
以下代码演示了如何通过getResAsync加载资源<pre> RES.getResAsync("resource/example.json");//只传入key值获取资源 RES.getResAsync("resource/example.json", (data) => { console.log(data) }, this) //传入key值,compFunc和thisObject获取资源,后两个必须同时出现</pre>
Egret 5.2
Web
zh_CN
异步方式获取配置里的资源。只要是配置文件里存在的资源,都可以通过异步方式获取。
Param: key
对应配置文件里的 name 属性或 sbuKeys 属性的一项。
Param: compFunc
回调函数。示例:compFunc(data,key):void。
Param: thisObject
回调函数的 this 引用。
See
#setMaxRetryTimes
Example
Version
Egret 5.2
Platform
Web
Language
zh_CN