Variables
Const CACHE_KEY
CACHE_KEY: "__ccclassCache__" = "__ccclassCache__"
Const boolean
boolean: (target: Object, propertyKey: string | symbol) => void = type(CCBoolean)
Type declaration
-
- (target: Object, propertyKey: string | symbol): void
-
Parameters
-
target: Object
-
propertyKey: string | symbol
Returns void
Const ccclass
ccclass: (name?: undefined | string) => ClassDecorator & ClassDecorator = makeSmartClassDecorator<string>((constructor, name) => {let base = js.getSuper(constructor);if (base === Object) {base = null;}const proto = {name,extends: base,ctor: constructor,__ES6__: true,};const cache = constructor[CACHE_KEY];if (cache) {const decoratedProto = cache.proto;if (decoratedProto) {// decoratedProto.properties = createProperties(ctor, decoratedProto.properties);js.mixin(proto, decoratedProto);}constructor[CACHE_KEY] = undefined;}const res = CCClass(proto);// validate methodsif (DEV) {const propNames = Object.getOwnPropertyNames(constructor.prototype);for (let i = 0; i < propNames.length; ++i) {const prop = propNames[i];if (prop !== 'constructor') {const desc = Object.getOwnPropertyDescriptor(constructor.prototype, prop);const func = desc && desc.value;if (typeof func === 'function') {doValidateMethodWithProps_DEV(func, prop, js.getClassName(constructor), constructor, base);}}}}return res;})
Const disallowAnimation
disallow
Animation: LegacyPropertyDecorator = !EDITOR ? emptyDecorator: (target, propertyKey, descriptor) => {return property({__noImplicit: true,animatable: false,})(target, propertyKey, descriptor);}
Const disallowMultiple
disallowMultiple: ClassDecorator & (yes?: undefined | false | true) => ClassDecorator = DEV ? emptySmartClassDecorator : makeSmartEditorClassDecorator('disallowMultiple')
Const displayName
display
Name: (text: string) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(text) => {return property(makeEditable({displayName: text,}));}
Const displayOrder
display
Order: (order: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(order) => {return property(makeEditable({displayOrder: order,}));}
Const editable
editable
: LegacyPropertyDecorator = !DEV ? emptyDecorator: (target, propertyKey, descriptor) => {return property(makeEditable({ }))(target, propertyKey, descriptor);}
Const emptySmartClassDecorator
empty
SmartClassDecorator: <TFunction>(target: TFunction) => TFunction | void & (arg?: TArg) => ClassDecorator = makeSmartClassDecorator(() => {})
Const executeInEditMode
executeInEditMode: ClassDecorator & (yes?: undefined | false | true) => ClassDecorator = DEV ? makeSmartEditorClassDecorator('executeInEditMode', true) : emptySmartClassDecorator
Const executionOrder
executionOrder: (priority: number) => ClassDecorator = makeEditorClassDecoratorFn('executionOrder')
Type declaration
-
- (priority: number): ClassDecorator
-
Parameters
Returns ClassDecorator
Const float
float: (target: Object, propertyKey: string | symbol) => void = type(CCFloat)
Type declaration
-
- (target: Object, propertyKey: string | symbol): void
-
Parameters
-
target: Object
-
propertyKey: string | symbol
Returns void
Const help
help: (url: string) => ClassDecorator = DEV ? makeEditorClassDecoratorFn('help') : emptyDecoratorFn
Type declaration
-
- (url: string): ClassDecorator
-
Parameters
Returns ClassDecorator
Private Const icon
icon: (url: string) => ClassDecorator = DEV ? makeEditorClassDecoratorFn('icon') : emptyDecoratorFn
Type declaration
-
- (url: string): ClassDecorator
-
Parameters
Returns ClassDecorator
Const inspector
inspector: (url: string) => ClassDecorator = DEV ? makeEditorClassDecoratorFn('inspector') : emptyDecoratorFn
Type declaration
-
- (url: string): ClassDecorator
-
Parameters
Returns ClassDecorator
Const integer
integer: (target: Object, propertyKey: string | symbol) => void = type(CCInteger)
Type declaration
-
- (target: Object, propertyKey: string | symbol): void
-
Parameters
-
target: Object
-
propertyKey: string | symbol
Returns void
Const menu
menu: (path: string) => ClassDecorator = DEV ? makeEditorClassDecoratorFn('menu') : emptyDecoratorFn
Type declaration
-
- (path: string): ClassDecorator
-
Parameters
Returns ClassDecorator
Const multiline
multiline
: LegacyPropertyDecorator = !DEV ? emptyDecorator:(target, propertyKey, descriptor) => {return property(makeEditable({multiline: true,}))(target, propertyKey, descriptor);}
Const playOnFocus
playOnFocus: ClassDecorator & (yes?: undefined | false | true) => ClassDecorator = DEV ? makeSmartEditorClassDecorator<boolean>('playOnFocus') : emptySmartClassDecorator
Const radian
radian
: LegacyPropertyDecorator = !DEV ? emptyDecorator:(target, propertyKey, descriptor) => {return property(makeEditable({radian: true,}))(target, propertyKey, descriptor);}
Const range
range
: (values
: [number, number, number] | [number, number]) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(values) => {return property(makeEditable({range: values,}));}
Type declaration
-
-
Parameters
-
values: [number, number, number] | [number, number]
Const rangeMax
range
Max: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(value) => {return property(makeEditable({max: value,}));}
Const rangeMin
range
Min: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(value) => {return property(makeEditable({min: value,}));}
Const rangeStep
range
Step: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(value) => {return property(makeEditable({step: value,}));}
Const readOnly
read
Only: LegacyPropertyDecorator = !DEV ? emptyDecorator: (target, propertyKey, descriptor) => {return property(makeEditable({readonly: true,}))(target, propertyKey, descriptor);}
Const requireComponent
requireComponent: (requiredComponent: Function) => ClassDecorator = makeEditorClassDecoratorFn('requireComponent')
Type declaration
-
- (requiredComponent: Function): ClassDecorator
-
Parameters
-
requiredComponent: Function
Returns ClassDecorator
Const slide
slide
: LegacyPropertyDecorator = !DEV ? emptyDecorator:(target, propertyKey, descriptor) => {return property(makeEditable({slide: true,}))(target, propertyKey, descriptor);}
Const string
string: (target: Object, propertyKey: string | symbol) => void = type(CCString)
Type declaration
-
- (target: Object, propertyKey: string | symbol): void
-
Parameters
-
target: Object
-
propertyKey: string | symbol
Returns void
Const tooltip
tooltip
: (text
: string) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(text) => {return property(makeEditable({tooltip: text,}));}
Const unit
unit
: (name
: "lm" | "lx" | "cd/m²") => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(name) => {return property(makeEditable({unit: name,}));}
Type declaration
-
-
Parameters
-
name: "lm" | "lx" | "cd/m²"
Const visible
visible
: (condition
: boolean | (() => boolean)) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn:(condition) => {return property(makeEditable({visible: condition,}));}
Type declaration
-
-
Parameters
-
condition: boolean | (() => boolean)
The signature compatible with both TypeScript legacy decorator and Babel legacy decorator. The
descriptor
argument will only appear in Babel case.该签名同时兼容 TypeScript legacy 装饰器以及 Babel legacy 装饰器。
descriptor
参数只会在 Babel 情况下出现。