MVVM框架兼容3.6.2编辑器预览模式

This commit is contained in:
dgflash
2022-11-05 10:49:22 +08:00
parent a73c71069d
commit dd55806f5d
5 changed files with 28 additions and 34 deletions

View File

@@ -145,8 +145,8 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 640,
"y": 375,
"x": 600,
"y": 360,
"z": 0
},
"_lrot": {
@@ -227,7 +227,7 @@
"_priority": 1073741824,
"_fov": 45,
"_fovAxis": 0,
"_orthoHeight": 375,
"_orthoHeight": 402.7397260273973,
"_near": 1,
"_far": 2000,
"_color": {
@@ -270,8 +270,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 750
"width": 1200,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",

View File

@@ -242,7 +242,7 @@
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -262.5,
"y": -247.5,
"z": 0
},
"_lrot": {
@@ -429,8 +429,8 @@
"__id__": 17
},
"templateMode": false,
"labelType": "cc.Label",
"watchPath": "*.prompt",
"labelType": "cc.Label",
"watchPathArr": [
""
],
@@ -741,8 +741,8 @@
"__id__": 33
},
"templateMode": true,
"labelType": "cc.Label",
"watchPath": "",
"labelType": "cc.Label",
"watchPathArr": [
"*.progress"
],
@@ -942,8 +942,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 750
"width": 1200,
"height": 720
},
"_anchorPoint": {
"__type__": "cc.Vec2",

View File

@@ -16,21 +16,14 @@ const { ccclass, property } = _decorator;
export class Demo extends Component {
private lang: boolean = true;
async onLoad() {oops.gui.remove
async onLoad() {
oops.gui.remove
// var path = "gui/prefab/role_info_base";
// var node = await ViewUtil.createPrefabNodeAsync(path);
// node.parent = this.node;
}
start() {
// 释放加载界面资源
// if (DEV && EDITOR) {
// // 编辑器中预览
// }
// else if (DEV && !EDITOR) {
// // 浏览器中预览
// }
// console.log("内存中现有资源", DEV, EDITOR, sys.isBrowser);
// resLoader.dump();
// console.log("当前图集数量", dynamicAtlasManager.atlasCount);

View File

@@ -4,14 +4,13 @@
* @LastEditors: dgflash
* @LastEditTime: 2022-08-29 13:37:08
*/
import { sys, _decorator } from "cc";
import { resLoader } from "../../../../../extensions/oops-plugin-framework/assets/core/common/loader/ResLoader";
import { _decorator } from "cc";
import { oops } from "../../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { JsonUtil } from "../../../../../extensions/oops-plugin-framework/assets/core/utils/JsonUtil";
import { ecs } from "../../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { UIID } from "../../common/config/GameUIConfig";
import { GameEvent } from "../../common/config/GameEvent";
import { CCVMParentComp } from "../../../../../extensions/oops-plugin-framework/assets/module/common/CCVMParentComp";
import { GameEvent } from "../../common/config/GameEvent";
import { UIID } from "../../common/config/GameUIConfig";
import { smc } from "../../common/ecs/SingletonModuleComp";
import { TableRoleJob } from "../../common/table/TableRoleJob";
import { TableRoleLevelUp } from "../../common/table/TableRoleLevelUp";
@@ -37,19 +36,18 @@ export class LoadingViewComp extends CCVMParentComp {
private progress: number = 0;
reset(): void {
// 获取用户信息的多语言提示文本
this.data.prompt = oops.language.getLangByID("loading_load_player");
setTimeout(() => {
// 关闭加载界面
oops.gui.remove(UIID.Loading);
// 关闭加载界面
oops.gui.remove(UIID.Loading);
// 打开游戏主界面(自定义逻辑)
oops.gui.open(UIID.Demo);
// 打开游戏主界面(自定义逻辑)
oops.gui.open(UIID.Demo);
}, 500);
}
start() {
// if (!sys.isNative) {
this.enter();
this.enter();
// }
}
@@ -95,7 +93,7 @@ export class LoadingViewComp extends CCVMParentComp {
// 加载初始游戏内容资源的多语言提示文本
this.data.prompt = oops.language.getLangByID("loading_load_game");
resLoader.loadDir("game", this.onProgressCallback.bind(this), this.onCompleteCallback.bind(this));
oops.res.loadDir("game", this.onProgressCallback.bind(this), this.onCompleteCallback.bind(this));
}
/** 加载进度事件 */
@@ -112,6 +110,9 @@ export class LoadingViewComp extends CCVMParentComp {
/** 加载完成事件 */
private onCompleteCallback() {
// 获取用户信息的多语言提示文本
this.data.prompt = oops.language.getLangByID("loading_load_player");
// 初始化帐号模块
smc.account.connect();
}

View File

@@ -2,8 +2,8 @@
"__version__": "1.0.2",
"general": {
"designResolution": {
"width": 1280,
"height": 750,
"width": 1200,
"height": 720,
"fitWidth": false,
"fitHeight": true
}