78 lines
1.5 KiB
TypeScript
Raw Normal View History

2025-01-06 16:17:01 +08:00
export enum CompType {
2025-01-06 19:46:38 +08:00
Node = "cc.Node",
Spirte = "cc.Sprite",
Label = "cc.Label",
Widget = "cc.Widget",
Camera = "cc.Camera",
UITransform = "cc.UITransform",
2025-01-06 16:17:01 +08:00
}
export function getSimpleProperties(typeName: string): string[] {
const config = {};
2025-01-06 19:46:38 +08:00
config[CompType.Node] = [
"position", //
"rotation",
"scale",
"anchor",
"size",
"color",
"opacity",
"skew",
"group",
//----------
"worldPosition",
"worldScale",
// "worldRotation",// 渲染有问题,暂时先不支持这个属性
];
config[CompType.UITransform] = ["anchor", "size"];
config[CompType.Widget] = [
"left",
"right",
"top",
"bottom",
"alignMode", //
"isAlignLeft",
"isAlignRight",
"isAlignTop",
"isAlignBottom",
];
config[CompType.Label] = [
"string", //
"horizontalAlign",
"verticalAlign",
"fontSize",
"lineHeight",
"overflow",
"font",
"fontFamily",
"ebableBold",
"enableItalic",
"enableUnderline",
"underlineHeight",
"cacheMode",
"useSystemFont",
];
config[CompType.Camera] = ["clearColor", "clearFlags", "cullingMask", "depth", "zoomRatio", "alignWithScreen"];
config[CompType.Spirte] = [
"atlas",
"spriteFrame",
"type",
"sizeMode", //
"fillCenter",
"fillRange",
"fillRange",
"fillStart",
"fillType",
"grayscale",
"color",
"spriteAtlas",
"trim",
"type",
];
2025-01-06 17:58:33 +08:00
return config[typeName] || [];
2025-01-06 16:17:01 +08:00
}
2025-01-06 17:58:33 +08:00
export const VisibleProp = {
Active: "active",
Enabled: "enabled",
};