mirror of
				https://github.com/tidys/cc-inspector-chrome
				synced 2025-11-04 12:35:25 +00:00 
			
		
		
		
	给节点增加组件的功能暂时屏蔽,opacity组件没办法全局拿到
This commit is contained in:
		@@ -103,6 +103,7 @@ export enum Msg {
 | 
				
			|||||||
   * 获取页面ID
 | 
					   * 获取页面ID
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  GetTabID = "GetTabID",
 | 
					  GetTabID = "GetTabID",
 | 
				
			||||||
 | 
					  AddOpactiy = "add-opacity",
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * 用户主动选中的节点
 | 
					   * 用户主动选中的节点
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,6 +37,14 @@ export class Inspector extends InjectEvent {
 | 
				
			|||||||
        this.updateTreeInfo();
 | 
					        this.updateTreeInfo();
 | 
				
			||||||
        break;
 | 
					        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: {
 | 
					      case Msg.VisibleFPS: {
 | 
				
			||||||
        const b = pluginEvent.data as boolean;
 | 
					        const b = pluginEvent.data as boolean;
 | 
				
			||||||
        if (b) {
 | 
					        if (b) {
 | 
				
			||||||
@@ -358,7 +366,7 @@ export class Inspector extends InjectEvent {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  _isCocosGame() {
 | 
					  _isCocosGame() {
 | 
				
			||||||
    // @ts-ignore 检测是否包含cc变量
 | 
					    // @ts-ignore 检测是否包含cc变量
 | 
				
			||||||
    return typeof cc !== "undefined";
 | 
					    return typeof cc !== "undefined" && cc && typeof cc.ENGINE_VERSION !== "undefined";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  getAllPropertyDescriptors(obj: Object): string[] {
 | 
					  getAllPropertyDescriptors(obj: Object): string[] {
 | 
				
			||||||
@@ -1023,14 +1031,6 @@ export class Inspector extends InjectEvent {
 | 
				
			|||||||
      this.sendMsgToContent(Msg.ResponseNodeInfo, data as ResponseNodeInfoData);
 | 
					      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 {
 | 
					  _isReadonly(base: Object, key: string | number): boolean {
 | 
				
			||||||
    let ret = Object.getOwnPropertyDescriptor(base, key);
 | 
					    let ret = Object.getOwnPropertyDescriptor(base, key);
 | 
				
			||||||
    if (ret) {
 | 
					    if (ret) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -368,6 +368,16 @@ export default defineComponent({
 | 
				
			|||||||
          },
 | 
					          },
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
        menus.push({ type: ccui.menu.MenuType.Separator });
 | 
					        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({
 | 
					        menus.push({
 | 
				
			||||||
          name: "game info",
 | 
					          name: "game info",
 | 
				
			||||||
          callback(item) {
 | 
					          callback(item) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user