12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- import { Prefab, SpriteFrame, Texture2D } from "cc";
- /*['data', {
- loadAtLaunch: true,//是否加载配置的bundle
- preloadAssets: [
- { path: 'textures/background', skipLoading: true }这个资源跳过加载
- { path: 'csv', isDirectory: true }, // 加载csv目录下所有文件
- { path: 'json/config', isDirectory: true }, // 加载config目录下所有文件
- { path: 'special/item', type: Prefab } // 单独加载某个特定资源
- ],
- autoLoadAll: true //自动加载所有资源
- excludePaths?: [],//要排除的资源路径前缀(当autoLoadAll为true时生效
- excludeExtensions?: []//要排除的文件扩展名(如['.meta']
- }],
- ['prefabs', {
- loadAtLaunch: true,
- preloadAssets: [
- { path: 'ui', isDirectory: true, type: Prefab }, // 加载ui目录下所有Prefab
- { path: 'effects', isDirectory: true } // 加载effects目录下所有资源
- { path: 'enemies/enemie_01', type: Prefab },
- { path: 'enemies/enemie_02', type: Prefab },
- { path: 'texture/msg_hint/spriteFrame', type: SpriteFrame },
- { path: 'texture/test_01/texture', type: Texture2D },
- { path: 'texture/test_02/spriteFrame', type: SpriteFrame }
- ]
- }]*/
- //游戏初始化资源加载配置
- export const bundleConfig: any = new Map([
- ['audios', {
- loadAtLaunch: true,
- autoLoadAll: true //自动加载所有资源
- }],
- ['data', {
- loadAtLaunch: true,
- preloadAssets: [
- { path: 'csv', isDirectory: true},
- ]
- }],
- ['prefabs', {
- loadAtLaunch: true,//参与启动加载
- preloadAssets: [
- /*{ path: 'enemy/enemy/generalPistol', type: Prefab },
- { path: 'enemy/enemy/scatterCaptain', type: Prefab },
- { path: 'enemy/enemy/shieldSoldier', type: Prefab },
- { path: 'enemy/enemy/snipeCaptain', type: Prefab },
- { path: 'enemy/enemy/sniperSoldier', type: Prefab },
- { path: 'enemy/enemy/soldierPistol', type: Prefab },
- { path: 'enemy/enemy/tank', type: Prefab },*/
- { path: 'enemy/gun/pistol', type: Prefab },
- { path: 'enemy/gun/scatter', type: Prefab },
- { path: 'enemy/gun/shield', type: Prefab },
- { path: 'enemy/gun/sniper_rifle', type: Prefab },
- { path: 'enemy/gun/tank_pao', type: Prefab },
- { path: 'player/98k', type: Prefab },
- /*{ path: 'player/m24', type: Prefab },
- { path: 'player/awm', type: Prefab },
- { path: 'player/barrettM82A1', type: Prefab },
- { path: 'player/m416', type: Prefab },
- { path: 'player/akm', type: Prefab },
- { path: 'player/vss', type: Prefab },
- { path: 'player/sks', type: Prefab },*/
- { path: 'texture/msg_hint/spriteFrame', type: SpriteFrame },
- { path: 'texture/test_01/texture', type: Texture2D },
- { path: 'texture/test_02/spriteFrame', type: SpriteFrame }
- ]
- }]
- ]);
|