Skip to content

Commit 17a0bca

Browse files
committed
feat: new options in property descriptor
1 parent 55545f2 commit 17a0bca

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/layaAir/Decorators.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,17 @@ export interface FPropertyDescriptor {
190190
reverseBool: boolean;
191191

192192
/**
193-
* @en Whether to allow null values. Default is true.
194-
* @zh 是否允许null值。默认为true。
193+
* @en Whether null values are allowed. Default is true. Sometimes it is necessary to explicitly set it to true, e.g. to display a checkbox for a color/vec2/vec3/vec4 inspector to determine whether the property value is null.
194+
* @zh 是否允许null值。默认为true。有时需要显式设置为true,例如为了显示一个color/vec2/vec3/vec4检查器的checkbox,决定属性值是否为null。
195195
*/
196196
nullable: boolean;
197197

198+
/**
199+
* @en For a property that can switch between null and non-null, when switching from a null value to a non-null value, the value here will be used.
200+
* @zh 对于可以在null和非null之间切换的属性,从null值切换到非null值时,会使用这里的值。
201+
*/
202+
nonNullDefault?: any;
203+
198204
/**
199205
* @en Minimum value for numbers
200206
* @zh 数字的最小值
@@ -268,14 +274,12 @@ export interface FPropertyDescriptor {
268274
showAlpha: boolean;
269275

270276
/**
271-
* @en Applicable to color type properties. It differs from the default value in that when default is null, defaultColor can define a non-null default value.
272-
* @zh 对颜色类型属性适用。它与default值不同的是,当default是null时,可以用defaultColor定义一个非null时的默认值。
277+
* @deprecated Use 'nonNullDefault' instead.
273278
*/
274279
defaultColor: any;
275280

276281
/**
277-
* @en Applicable to color type properties. Allows displaying a checkbox to determine whether the color is null.
278-
* @zh 对颜色类型属性适用。允许显示一个checkbox决定颜色是否为null。
282+
* @deprecated Explicitly set 'nullable' to true to display a checkbox.
279283
*/
280284
colorNullable: boolean;
281285

0 commit comments

Comments
 (0)