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,};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) => property({__noImplicit: true,animatable: false,})(target, propertyKey, descriptor)
Const disallowMultiple
disallowMultiple: ClassDecorator & (yes?: undefined | false | true) => ClassDecorator = DEV ? makeSmartEditorClassDecorator('disallowMultiple', true) : emptySmartClassDecorator
Const displayName
display
Name: (text: string) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (text) => property(makeEditable({displayName: text,}))
Const displayOrder
display
Order: (order: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (order) => property(makeEditable({displayOrder: order,}))
Const editable
editable
: LegacyPropertyDecorator = !DEV ? emptyDecorator : (target, propertyKey, descriptor) => 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) => property(makeEditable({multiline: true,}))(target, propertyKey, descriptor)
Const playOnFocus
playOnFocus: ClassDecorator & (yes?: undefined | false | true) => ClassDecorator = DEV ? makeSmartEditorClassDecorator<boolean>('playOnFocus', true) : emptySmartClassDecorator
Const radian
radian
: LegacyPropertyDecorator = !DEV ? emptyDecorator: (target, propertyKey, descriptor) => property(makeEditable({radian: true,}))(target, propertyKey, descriptor)
Const range
range
: (values
: [] | []) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (values) => property(makeEditable({range: values,}))
Const rangeMax
range
Max: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (value) => property(makeEditable({max: value,}))
Const rangeMin
range
Min: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (value) => property(makeEditable({min: value,}))
Const rangeStep
range
Step: (value: number) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (value) => property(makeEditable({step: value,}))
Const readOnly
read
Only: LegacyPropertyDecorator = !DEV ? emptyDecorator : (target, propertyKey, descriptor) => 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) => 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) => property(makeEditable({tooltip: text,}))
Const unit
unit
: (name
: "lm" | "lx" | "cd/m²") => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (name) => property(makeEditable({unit: name,}))
Type declaration
-
-
Parameters
-
name: "lm" | "lx" | "cd/m²"
Const visible
visible
: (condition
: boolean | (() => boolean)) => LegacyPropertyDecorator = !DEV ? emptyDecoratorFn: (condition) => property(makeEditable({visible: condition,}))
Type declaration
-
-
Parameters
-
condition: boolean | (() => boolean)
CCClass 属性选项。
CCClass property options