Merged
Conversation
knoxHuang
reviewed
Apr 13, 2026
| } | ||
|
|
||
|
|
||
|
|
knoxHuang
reviewed
Apr 13, 2026
| await EditorExtends.init(); | ||
| } | ||
|
|
||
| // await (globalThis as any).System.import('cc'); |
knoxHuang
reviewed
Apr 13, 2026
|
|
||
| // 切换物理引擎 | ||
| cc.physics.selector.switchTo(backend); | ||
| cc.view.setDesignResolutionSize(1920, 1080, cc.ResolutionPolicy.SHOW_ALL); |
Contributor
There was a problem hiding this comment.
不能写死,后续可能要读配置,可以写个 TODO 吧
knoxHuang
reviewed
Apr 13, 2026
| cc.game.pause(); | ||
| const json = startScene; | ||
| // load scene | ||
| cc.assetManager.loadWithJson(json, { assetId: json[1]._id }, |
Contributor
There was a problem hiding this comment.
最好初始化跟加载场景区分开来,后续可能先初始化 webview,加快场景打开的速度
knoxHuang
reviewed
Apr 13, 2026
src/core/engine/index.ts
Outdated
| } | ||
|
|
||
| async getDefaultConfig(serverURL: string, importBase: string, nativeBase: string) { | ||
| async getPreviewConfig(serverURL: string, importBase: string, nativeBase: string) { |
Contributor
There was a problem hiding this comment.
如果这个是共用的,就不要写 PreviewConfig,叫 getSettingConfig ?否则也容易误导
knoxHuang
reviewed
Apr 13, 2026
Contributor
There was a problem hiding this comment.
如果这个是通用的,就改个名字吧,不要 preview,否则可能容易误导
knoxHuang
reviewed
Apr 13, 2026
static/web/index.ejs
Outdated
| <canvas id="GameCanvas" tabindex="-1" style="background-color: '';"></canvas> | ||
| </div> | ||
| </div> | ||
| <!-- <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas> --> |
knoxHuang
reviewed
Apr 13, 2026
static/web/index.ejs
Outdated
| @@ -73,19 +78,20 @@ | |||
Contributor
There was a problem hiding this comment.
这个最好是一个入口函数,需要 pink 那边加载,否则要写 2 边
knoxHuang
reviewed
Apr 13, 2026
static/web/index.ejs
Outdated
| // closure matches its register. One System = no bridging needed. | ||
| globalThis.System = _originalSystem; | ||
|
|
||
| const sceneListPromise = await fetch(`${currentUrl}/query-asset-infos/cc.SceneAsset`); |
Contributor
There was a problem hiding this comment.
你这里其实需要做的,只需要做到初始化引擎 + 初始化场景流程就行,不需要去主动加载场景,加载场景是外部调用 打开 API 触发的
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.