Fix the issue where project script registration was not recognized. (#24)

This commit is contained in:
Knox
2025-10-16 20:43:15 +08:00
committed by GitHub
parent 971366f49f
commit 598dac7599
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -23,7 +23,7 @@
THE SOFTWARE.
*/
import { DEV, EDITOR, SUPPORT_JIT, TEST } from 'internal:constants';
import { DEV, EDITOR, SUPPORT_JIT, TEST, NODEJS } from 'internal:constants';
import { errorID, warnID, error } from '../platform/debug';
import * as js from '../utils/js';
import { getSuper } from '../utils/js';
@@ -179,7 +179,7 @@ function define (className, baseClass, options): any {
const cls = doDefine(className, baseClass, options);
if (EDITOR) {
if (EDITOR || NODEJS) {
// for RenderPipeline, RenderFlow, RenderStage
const isRenderPipeline = js.isChildClassOf(baseClass, legacyCC.RenderPipeline);
const isRenderFlow = js.isChildClassOf(baseClass, legacyCC.RenderFlow);
+1 -1
View File
@@ -996,7 +996,7 @@ export class Game extends EventTarget {
if (PREVIEW && !TEST && !EDITOR && !NATIVE && !NODEJS) {
const bundleName = 'cce:/internal/x/prerequisite-imports';
import(bundleName).then((): void => resolve(), (reason): void => reject(reason));
} else if (EDITOR && globalThis.cce && globalThis.cce.Script) {
} else if ((EDITOR || NODEJS) && globalThis.cce && globalThis.cce.Script) {
globalThis.cce.Script.init().then(() => resolve());
} else {
resolve();