Negotiable Paleobotanist Missions

    iam-ccc-loadassets-typescript

    1.0.0 • Public • Published

    iam-ccc-loadassets-typescript

    Cocos Creator 的资源加载辅助函数

    ~

    载入单个资源

    const res = await loadAsset<Prefab>("player");

    载入多个资源,返回包含名字与资源实例的字典

    用法1:

    // res = [资源名]
    const res = await loadAssets<Prefab>(["map/tileset", "map/widgets"]);
    // res = {
    //   "map/tileset": Prefab,
    //   "map/widgets": Prefab
    // }

    用法2:

    // res = {别名: 资源名}
    const res = await loadAssets<Prefab>(["tileset": "map/tileset", "widgets": "map/widgets"])
    // res = {
    //   "tileset": Prefab,
    //   "widgets": Prefab
    // }

    Install

    npm i iam-ccc-loadassets-typescript

    DownloadsWeekly Downloads

    0

    Version

    1.0.0

    License

    Apache-2.0

    Unpacked Size

    15.4 kB

    Total Files

    7

    Last publish

    Collaborators

    • dualface