From 8a8c9c92e87686863fe186c080d291731d5eaf5a Mon Sep 17 00:00:00 2001 From: xu_yanfeng Date: Tue, 11 Feb 2025 20:41:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D2x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/inject/code-hint.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripts/inject/code-hint.ts b/src/scripts/inject/code-hint.ts index 23b3881..fe9ba33 100644 --- a/src/scripts/inject/code-hint.ts +++ b/src/scripts/inject/code-hint.ts @@ -27,7 +27,7 @@ function getButton(node: any, fillFn: boolean): FunctionInfo[] { const ret: FunctionInfo[] = []; for (let i = 0; i < arr.length; i++) { const item = arr[i]; - const compType = cc.js.getClassById(item._componentId); + const compType = cc.js._getClassById(item._componentId); if (!compType) { continue; } @@ -47,6 +47,9 @@ function getButton(node: any, fillFn: boolean): FunctionInfo[] { } export function getCallbacks(node: any, code: ShowCode, fillFn: boolean = false): FunctionInfo[] { + if (node instanceof cc.Scene) { + return []; + } if (code === ShowCode.ButtonClickEvents) { return getButton(node, fillFn); } else {