mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
CCClass: Support unit and displayOrder (#4104)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user