cc.loader.loadRes 该怎么使用
时间: 2023-12-25 11:05:29
浏览: 70
`cc.loader.loadRes` 方法可以用来加载指定路径下的资源,包括[图片]([http](https://geek.csdn.net/educolumn/68f28ca3131d47699e5902c5d3d74d51?spm=1055.2569.3001.10083)s://geek.csdn.net/educolumn/1de9845baad351038ab25b200eff4431?spm=1055.2569.3001.10083)、声音、预制件、材质等等。该方法的语法如下:
```[javascript](https://geek.csdn.net/educolumn/3e427b9940783449029130030e9c9e62?spm=1055.2569.3001.10083)
cc.loader.loadRes(url, type, progress[call](https://geek.csdn.net/educolumn/3cda1aeab044ec99e05646be0d6f9d8e?spm=1055.2569.3001.10083)back, completed[call](https://geek.csdn.net/educolumn/3cda1aeab044ec99e05646be0d6f9d8e?spm=1055.2569.3001.10083)back);
```