init git
This commit is contained in:
11
assets/FishSingle/script/engine/config/CommonEvent.ts
Normal file
11
assets/FishSingle/script/engine/config/CommonEvent.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { _decorator } from 'cc'
|
||||
const { ccclass, property } = _decorator
|
||||
|
||||
@ccclass('CommonEvent')
|
||||
export default class CommonEvent {
|
||||
public static Event_FrameUpdate: string = 'Event_FrameUpdate'
|
||||
public static Event_ConnectTimeOut: string = 'Event_ConnectTimeOut'
|
||||
public static Event_ResourceLoader: string = 'Event_ResourceLoader'
|
||||
public static Event_CheckUpdate: string = 'Event_CheckUpdate'
|
||||
public static Event_Scene_Switch: string = 'Event_Scene_Switch'
|
||||
}
|
||||
11
assets/FishSingle/script/engine/config/CommonEvent.ts.meta
Normal file
11
assets/FishSingle/script/engine/config/CommonEvent.ts.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "76f96525-e455-4a24-9d2b-27a0cb2fdfd2",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
38
assets/FishSingle/script/engine/config/ManifestConfig.ts
Normal file
38
assets/FishSingle/script/engine/config/ManifestConfig.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import { _decorator } from 'cc'
|
||||
import DateUtil from '../utils/DateUtil'
|
||||
import NetConfig from './NetConfig'
|
||||
|
||||
export default class ManifestConfig {
|
||||
public static packageUrl: string = ''
|
||||
public static remoteManifestUrl: string = ''
|
||||
public static remoteVersionUrl: string = ''
|
||||
public static version: string = '1.0.0' //更新包要更新这里
|
||||
public static assets: object = {}
|
||||
public static searchPaths: Array<any> = []
|
||||
public static getManifestStr(key: string) {
|
||||
let obj: Object = {}
|
||||
obj['packageUrl'] = `${NetConfig.hotupdateUrl}/hotupdate/${key}/`
|
||||
obj['remoteManifestUrl'] =
|
||||
NetConfig.hotupdateUrl +
|
||||
'/hotupdate/' +
|
||||
key +
|
||||
'/project.manifest?t=' +
|
||||
DateUtil.now()
|
||||
obj['remoteManifestUrl'] = `${
|
||||
NetConfig.hotupdateUrl
|
||||
}/hotupdate/${key}/project.manifest?t=${DateUtil.now()}`
|
||||
obj['remoteVersionUrl'] =
|
||||
NetConfig.hotupdateUrl +
|
||||
'/hotupdate/' +
|
||||
key +
|
||||
'/version.manifest?t=' +
|
||||
DateUtil.now()
|
||||
obj['remoteVersionUrl'] = `${
|
||||
NetConfig.hotupdateUrl
|
||||
}/hotupdate/${key}/version.manifest?t=${DateUtil.now()}`
|
||||
obj['version'] = ManifestConfig.version
|
||||
obj['assets'] = {}
|
||||
obj['searchPaths'] = []
|
||||
return JSON.stringify(obj)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "711d7240-649f-4cb4-9d0d-06e13979eb98",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
64
assets/FishSingle/script/engine/config/MusicConfig.ts
Normal file
64
assets/FishSingle/script/engine/config/MusicConfig.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
import { _decorator, AudioClip } from 'cc'
|
||||
import { GameConfig } from '../../game/config/GameConfig'
|
||||
|
||||
export default class MusicConfig {
|
||||
public static musicKey2Path: Map<string, string> = new Map<string, string>() //资源预加载路径
|
||||
|
||||
public static musicKey2Cache: Map<string, AudioClip> = new Map<
|
||||
string,
|
||||
AudioClip
|
||||
>() //资源加载后cache路径
|
||||
|
||||
public static init() {
|
||||
if (
|
||||
typeof GameConfig.GameName === 'undefined' ||
|
||||
GameConfig.GameName === null
|
||||
) {
|
||||
console.error('GameConfig.GameName 未配置!')
|
||||
return
|
||||
}
|
||||
|
||||
const musicConfig = {
|
||||
background_1: 'music/background_1',
|
||||
background_2: 'music/background_2',
|
||||
background_3: 'music/background_3',
|
||||
deadfish_1: 'music/deadfish_1',
|
||||
deadfish_2: 'music/deadfish_2',
|
||||
deadfish_3: 'music/deadfish_3',
|
||||
deadfish_4: 'music/deadfish_4',
|
||||
deadfish_5: 'music/deadfish_5',
|
||||
deadfish_6: 'music/deadfish_6',
|
||||
deadfish_7: 'music/deadfish_7',
|
||||
deadfish_8: 'music/deadfish_8',
|
||||
deadfish_9: 'music/deadfish_9',
|
||||
deadfish_10: 'music/deadfish_10',
|
||||
deadfish_11: 'music/deadfish_11',
|
||||
deadfish_12: 'music/deadfish_12',
|
||||
deadfish_13: 'music/deadfish_13',
|
||||
deadfish_14: 'music/deadfish_14',
|
||||
deadfish_15: 'music/deadfish_15',
|
||||
deadfish_16: 'music/deadfish_16',
|
||||
deadfish_17: 'music/deadfish_17',
|
||||
deadfish_18: 'music/deadfish_18',
|
||||
deadfish_19: 'music/deadfish_19',
|
||||
deadfish_20: 'music/deadfish_20',
|
||||
deadfish_21: 'music/deadfish_21',
|
||||
deadfish_22: 'music/deadfish_22',
|
||||
deadfish_23: 'music/deadfish_23',
|
||||
deadfish_24: 'music/deadfish_24',
|
||||
deadfish_25: 'music/deadfish_25',
|
||||
deadfish_26: 'music/deadfish_26',
|
||||
deadfish_27: 'music/deadfish_27',
|
||||
deadfish_28: 'music/deadfish_28',
|
||||
deadfish_29: 'music/deadfish_29',
|
||||
fire: 'music/fire',
|
||||
}
|
||||
// 音乐要预加载的配置
|
||||
for (const key in musicConfig) {
|
||||
if (musicConfig.hasOwnProperty(key)) {
|
||||
const path = `${GameConfig.GameName}/${musicConfig[key]}`
|
||||
MusicConfig.musicKey2Path.set(key, path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
assets/FishSingle/script/engine/config/MusicConfig.ts.meta
Normal file
11
assets/FishSingle/script/engine/config/MusicConfig.ts.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "92bd7fa0-c97e-4b6f-b518-d1d4d73c03f5",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
4
assets/FishSingle/script/engine/config/NetConfig.ts
Normal file
4
assets/FishSingle/script/engine/config/NetConfig.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { _decorator } from 'cc'
|
||||
export default class NetConfig {
|
||||
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
||||
}
|
||||
11
assets/FishSingle/script/engine/config/NetConfig.ts.meta
Normal file
11
assets/FishSingle/script/engine/config/NetConfig.ts.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "4e758c3c-41e2-4fe7-a0ea-43fe6be9b381",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"simulateGlobals": []
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user