update
This commit is contained in:
@@ -4,9 +4,9 @@ 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'
|
||||
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'
|
||||
}
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
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)
|
||||
}
|
||||
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) {
|
||||
const obj: {
|
||||
packageUrl?: string
|
||||
remoteManifestUrl?: string
|
||||
remoteVersionUrl?: string
|
||||
version?: string
|
||||
assets?: object
|
||||
searchPaths?: Array<any>
|
||||
} = {}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,64 +1,59 @@
|
||||
import { 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 musicKey2Path: Map<string, string> = new Map<string, string>() // 资源预加载路径
|
||||
|
||||
public static musicKey2Cache: Map<string, AudioClip> = new Map<
|
||||
string,
|
||||
AudioClip
|
||||
>() //资源加载后cache路径
|
||||
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
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
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 (Object.prototype.hasOwnProperty.call(musicConfig, key)) {
|
||||
const path = `${GameConfig.GameName}/${musicConfig[key]}`
|
||||
MusicConfig.musicKey2Path.set(key, path)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default class NetConfig {
|
||||
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
||||
public static hotupdateUrl: string = 'http://localhost:33/hotupdate'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user