给节点增加组件的功能暂时屏蔽,opacity组件没办法全局拿到

This commit is contained in:
xu_yanfeng 2025-02-21 10:53:57 +08:00
parent 641c291619
commit 346af08595
3 changed files with 20 additions and 9 deletions

View File

@ -103,6 +103,7 @@ export enum Msg {
* ID
*/
GetTabID = "GetTabID",
AddOpactiy = "add-opacity",
/**
*
*/

View File

@ -37,6 +37,14 @@ export class Inspector extends InjectEvent {
this.updateTreeInfo();
break;
}
case Msg.AddOpactiy: {
const id = pluginEvent.data as string;
const node = this.inspectorGameMemoryStorage[id];
if (node && node.isValid) {
const comp = cc.Ui;
}
break;
}
case Msg.VisibleFPS: {
const b = pluginEvent.data as boolean;
if (b) {
@ -358,7 +366,7 @@ export class Inspector extends InjectEvent {
_isCocosGame() {
// @ts-ignore 检测是否包含cc变量
return typeof cc !== "undefined";
return typeof cc !== "undefined" && cc && typeof cc.ENGINE_VERSION !== "undefined";
}
getAllPropertyDescriptors(obj: Object): string[] {
@ -1023,14 +1031,6 @@ export class Inspector extends InjectEvent {
this.sendMsgToContent(Msg.ResponseNodeInfo, data as ResponseNodeInfoData);
}
}
logValue(uuid: string, key: string) {
let nodeOrComp = this.inspectorGameMemoryStorage[uuid];
if (nodeOrComp) {
console.log(nodeOrComp[key]);
}
}
_isReadonly(base: Object, key: string | number): boolean {
let ret = Object.getOwnPropertyDescriptor(base, key);
if (ret) {

View File

@ -368,6 +368,16 @@ export default defineComponent({
},
});
menus.push({ type: ccui.menu.MenuType.Separator });
if (engineVersion.value.startsWith("3.x") && false) {
menus.push({
name: "add UIOpacity",
callback(item) {
ga.fireEventWithParam(GA_EventName.MouseMenu, item.name);
bridge.send(Msg.AddOpactiy, data.id);
},
});
menus.push({ type: ccui.menu.MenuType.Separator });
}
menus.push({
name: "game info",
callback(item) {