CCClass: Support unit and displayOrder (#4104)

This commit is contained in:
SijieWang
2019-03-26 10:54:36 +08:00
committed by Weiliang Wang
parent 96d587d106
commit 668d21aa80
2 changed files with 8 additions and 2 deletions
+6 -2
View File
@@ -45,7 +45,9 @@ export class SphereLightComponent extends LightComponent {
protected _type = LightType.SPHERE;
protected _light: SphereLight | null = null;
@property
@property({
unit: 'lm',
})
get luminousPower () {
return this._luminance * nt2lm(this._size);
}
@@ -55,7 +57,9 @@ export class SphereLightComponent extends LightComponent {
if (this._light) { this._light.setLuminousPower(val, this._size); }
}
@property
@property({
unit: 'cd',
})
get luminance () {
return this._luminance;
}
+2
View File
@@ -1160,12 +1160,14 @@ function parseAttributes (cls, attrs, className, propName, usedInGetter) {
//parseSimpleAttr('preventDeferredLoad', 'boolean');
if (CC_DEV) {
parseSimpleAttr('displayName', 'string');
parseSimpleAttr('displayOrder', 'number');
parseSimpleAttr('multiline', 'boolean');
if (attrs.readonly) {
(attrsProto || getAttrsProto())[attrsProtoKey + 'readonly'] = true;
}
parseSimpleAttr('tooltip', 'string');
parseSimpleAttr('slide', 'boolean');
parseSimpleAttr('unit', 'string');
}
if (attrs.url) {