mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-04-20 00:48:43 +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 = {
|
const manifest: CocosPluginManifest = {
|
||||||
name: pkgName,
|
name: pkgName,
|
||||||
version: "2.1.9",
|
version: "2.1.10",
|
||||||
description: "Debug games made with CocosCreator and display node trees and node properties",
|
description: "Debug games made with CocosCreator and display node trees and node properties",
|
||||||
store: "https://store.cocos.com/app/detail/2002",
|
store: "https://store.cocos.com/app/detail/2002",
|
||||||
author: "xu_yanfeng",
|
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;
|
declare const cc: any;
|
||||||
|
|
||||||
export function getEnumListConfig() {
|
export function getEnumListConfig() {
|
||||||
@ -268,7 +270,10 @@ export function getEnumListConfig() {
|
|||||||
{
|
{
|
||||||
key: "clearFlags",
|
key: "clearFlags",
|
||||||
values() {
|
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;
|
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;
|
return camera;
|
||||||
}
|
}
|
||||||
private getLayerID() {
|
private getLayerID() {
|
||||||
|
// FIXME: https://forum.cocos.org/t/topic/165550
|
||||||
return cc.Layers.Enum.GIZMOS;
|
return cc.Layers.Enum.GIZMOS;
|
||||||
}
|
}
|
||||||
getRectPoints(node: any): RectPoints | null {
|
getRectPoints(node: any): RectPoints | null {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user