适配creator v2版本的widget对pos的影响

This commit is contained in:
xu_yanfeng
2025-01-29 17:32:46 +08:00
parent 89f61e3b05
commit 31c5ccf7c6
2 changed files with 17 additions and 12 deletions

View File

@@ -25,11 +25,13 @@ export class Info {
public data: any;
public readonly: boolean = false;
public path: Array<string> = []; // 属性对应的路径
public tip: string = "";
constructor(id: string = "") {
this.id = id || v4();
}
parse(data: Info) {
this.id = data.id;
this.tip = data.tip || "";
this.path = data.path;
this.readonly = data.readonly;
}
@@ -324,6 +326,10 @@ export class StringData extends Info {
export class NumberData extends Info {
public data: number = 0;
public step: number = 1;
/**
* 是否禁用因为cc.Widget组件会影响调整x、y
*/
public disabled: boolean = false;
constructor(data: number = 0) {
super();
this.type = DataType.Number;
@@ -333,6 +339,7 @@ export class NumberData extends Info {
super.parse(data);
this.data = data.data;
this.step = data.step || 1;
this.disabled = !!data.disabled;
return this;
}
public isNumber(): boolean {