mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-12 05:01:03 +00:00
兼容2x camera.clearFlags的属性
This commit is contained in:
parent
ab6b98a99d
commit
a54c27c32b
@ -9,7 +9,7 @@ function i18n(key: string) {
|
||||
|
||||
const manifest: CocosPluginManifest = {
|
||||
name: pkgName,
|
||||
version: "2.1.9",
|
||||
version: "2.1.10",
|
||||
description: "Debug games made with CocosCreator and display node trees and node properties",
|
||||
store: "https://store.cocos.com/app/detail/2002",
|
||||
author: "xu_yanfeng",
|
||||
|
3
src/scripts/inject/connect-me.ts
Normal file
3
src/scripts/inject/connect-me.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export function help() {
|
||||
debugger;
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import { help } from "./connect-me";
|
||||
|
||||
declare const cc: any;
|
||||
|
||||
export function getEnumListConfig() {
|
||||
@ -268,7 +270,10 @@ export function getEnumListConfig() {
|
||||
{
|
||||
key: "clearFlags",
|
||||
values() {
|
||||
return cc.Camera.ClearFlag.__enums__;
|
||||
return adaptEnum(
|
||||
cc.Camera.ClearFlags || // TODO: 2x是个掩码,不是枚举
|
||||
cc.Camera.ClearFlag // 3.x是枚举
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
@ -307,3 +312,20 @@ export function getEnumListConfig() {
|
||||
];
|
||||
return enumConfig;
|
||||
}
|
||||
|
||||
function adaptEnum(list: any): Array<{ name: string; value: number }> {
|
||||
const target = list.__enums__;
|
||||
if (!target) {
|
||||
const arr = Object.keys(list).map((key) => {
|
||||
return {
|
||||
name: key,
|
||||
value: list[key],
|
||||
};
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
if (!Array.isArray(target)) {
|
||||
help();
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
@ -123,6 +123,7 @@ export class HintV3 extends HintAdapter {
|
||||
return camera;
|
||||
}
|
||||
private getLayerID() {
|
||||
// FIXME: https://forum.cocos.org/t/topic/165550
|
||||
return cc.Layers.Enum.GIZMOS;
|
||||
}
|
||||
getRectPoints(node: any): RectPoints | null {
|
||||
|
Loading…
x
Reference in New Issue
Block a user