mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-05-10 10:23:25 +08:00
fix: 编辑器
This commit is contained in:
parent
63179995cd
commit
5d54b205f0
@ -18,13 +18,6 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
||||
"_docs": "楼层列表",
|
||||
"_data": "在这里按顺序放所有的楼层;其顺序直接影响到楼层传送器、浏览地图和上/下楼器的顺序"
|
||||
},
|
||||
"plugin": {
|
||||
"_leaf": true,
|
||||
"_type": "textarea",
|
||||
"_range": "thiseval instanceof Array",
|
||||
"_docs": "插件列表",
|
||||
"_data": "在这里按顺序放所有的插件,顺序会影响到插件的加载,越靠前越早加载"
|
||||
},
|
||||
"floorPartitions": {
|
||||
"_leaf": true,
|
||||
"_type": "event",
|
||||
|
@ -276,10 +276,10 @@ function core() {
|
||||
core.prototype.init = async function (coreData, callback) {
|
||||
this._forwardFuncs();
|
||||
for (var key in coreData) core[key] = coreData[key];
|
||||
await this._loadGameProcess();
|
||||
this._init_flags();
|
||||
this._init_platform();
|
||||
this._init_others();
|
||||
await this._loadGameProcess();
|
||||
|
||||
var b = main.mode == 'editor';
|
||||
// 初始化画布
|
||||
@ -302,12 +302,12 @@ core.prototype.init = async function (coreData, callback) {
|
||||
};
|
||||
|
||||
core.prototype.initSync = function (coreData, callback) {
|
||||
this._loadGameProcessSync();
|
||||
this._forwardFuncs();
|
||||
for (var key in coreData) core[key] = coreData[key];
|
||||
this._init_flags();
|
||||
this._init_platform();
|
||||
this._init_others();
|
||||
this._loadGameProcessSync();
|
||||
|
||||
core.loader._load(function () {
|
||||
core._afterLoadResources(callback);
|
||||
@ -319,11 +319,9 @@ core.prototype._loadGameProcess = async function () {
|
||||
if (main.pluginUseCompress) {
|
||||
await main.loadScript(`project/processG.min.js?v=${main.version}`);
|
||||
} else {
|
||||
// if (main.mode === 'play') {
|
||||
// await main.loadScript(`src/game/index.ts`, true);
|
||||
// } else {
|
||||
// await main.loadScript(`src/game/index.esm.ts`, true);
|
||||
// }
|
||||
if (main.mode === 'editor') {
|
||||
await main.loadScript(`src/game/index.esm.ts`, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -521,17 +521,26 @@ loader.prototype.loadOneMusic = function (name) {
|
||||
if (main.bgmRemote)
|
||||
music.src = main.bgmRemoteRoot + core.firstData.name + '/' + name;
|
||||
else music.src = 'project/bgms/' + name;
|
||||
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
||||
if (main.mode === 'editor') {
|
||||
music.loop = 'loop';
|
||||
core.material.bgms[name] = music;
|
||||
} else {
|
||||
Mota.require('var', 'bgm').add(`bgms.${name}`, music);
|
||||
}
|
||||
};
|
||||
|
||||
loader.prototype.loadOneSound = function (name) {
|
||||
const sound = Mota.require('var', 'sound');
|
||||
core.http(
|
||||
'GET',
|
||||
'project/sounds/' + name + '?v=' + main.version,
|
||||
null,
|
||||
function (data) {
|
||||
sound.add(`sounds.${name}`, data);
|
||||
if (main.mode === 'editor') {
|
||||
core.loader._loadOneSound_decodeData(name, data);
|
||||
} else {
|
||||
const sound = Mota.require('var', 'sound');
|
||||
sound.add(`sounds.${name}`, data);
|
||||
}
|
||||
},
|
||||
function (e) {
|
||||
core.material.sounds[name] = null;
|
||||
|
@ -402,14 +402,24 @@ main.prototype.loadAsync = async function (mode, callback) {
|
||||
].forEach(function (t) {
|
||||
coreData[t] = main[t];
|
||||
});
|
||||
await core.init(coreData, callback);
|
||||
if (main.mode === 'play') main.loading.emit('coreInit');
|
||||
core.initStatus.maps = core.maps._initMaps();
|
||||
if (main.mode === 'play') {
|
||||
await core.init(coreData, callback);
|
||||
main.loading.emit('coreInit');
|
||||
core.initStatus.maps = core.maps._initMaps();
|
||||
} else {
|
||||
await core.init(coreData, () => {
|
||||
callback();
|
||||
core.initStatus.maps = core.maps._initMaps();
|
||||
});
|
||||
main.loading.emit('coreInit');
|
||||
}
|
||||
|
||||
core.resize();
|
||||
|
||||
main.core = core;
|
||||
|
||||
if (main.mode === 'editor') return;
|
||||
|
||||
// 自动放缩最大化
|
||||
let auto = Mota.require('var', 'mainSetting').getValue('autoScale', true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user