mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
Fix the issue where project script registration was not recognized. (#24)
This commit is contained in:
@@ -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
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user