Egret Engine R - v6.0.0
    Preparing search index...

    异步方式获取配置里的资源。只要是配置文件里存在的资源,都可以通过异步方式获取。

    对应配置文件里的 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>

    Egret 5.2

    Web

    zh_CN

    • 异步方式获取配置里的资源。只要是配置文件里存在的资源,都可以通过异步方式获取。

      Parameters

      • key: string

        对应配置文件里的 name 属性或 sbuKeys 属性的一项。

      Returns Promise<any>

      #setMaxRetryTimes

      Egret 5.2

      Web

      zh_CN

    • 异步方式获取配置里的资源。只要是配置文件里存在的资源,都可以通过异步方式获取。

      Parameters

      • key: string

        对应配置文件里的 name 属性或 sbuKeys 属性的一项。

      • compFunc: GetResAsyncCallback

        回调函数。示例:compFunc(data,key):void。

      • thisObject: any

        回调函数的 this 引用。

      Returns void | Promise<any>

      #setMaxRetryTimes

      Egret 5.2

      Web

      zh_CN