Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core/Decorator: Adjust @unit signature #15820

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cocos/core/data/decorators/editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import { getOrCreatePropertyStash } from './property';
import { PropertyStash, PropertyStashInternalFlag } from '../class-stash';

import { LegacyPropertyDecorator, emptyDecorator, makeSmartEditorClassDecorator, makeEditorClassDecoratorFn, emptySmartClassDecorator, emptyDecoratorFn } from './utils';

Check warning on line 30 in cocos/core/data/decorators/editable.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 169. Maximum allowed is 150

/**
* @en Makes a CCClass that inherits from component execute in edit mode.<br/>
Expand All @@ -47,7 +47,7 @@
* }
* ```
*/
export const executeInEditMode: ClassDecorator & ((yes?: boolean) => ClassDecorator) = DEV ? makeSmartEditorClassDecorator('executeInEditMode', true) : emptySmartClassDecorator;

Check warning on line 50 in cocos/core/data/decorators/editable.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 180. Maximum allowed is 150

/**
* @en Add the current component to the specific menu path in `Add Component` selector of the inspector panel
Expand Down Expand Up @@ -84,7 +84,7 @@
* }
* ```
*/
export const playOnFocus: ClassDecorator & ((yes?: boolean) => ClassDecorator) = DEV ? makeSmartEditorClassDecorator<boolean>('playOnFocus', true) : emptySmartClassDecorator;

Check warning on line 87 in cocos/core/data/decorators/editable.ts

View workflow job for this annotation

GitHub Actions / Run ESLint

This line has a length of 177. Maximum allowed is 150

/**
* @en Use a customized inspector page in the **inspector**
Expand Down Expand Up @@ -289,11 +289,7 @@
* 设置该属性在编辑器中的计量单位。
* @param name 计量单位的名称。
*/
export const unit: (name:
| 'lm'
| 'lx'
| 'cd/m²'
) => LegacyPropertyDecorator = !DEV
export const unit: (name: string) => LegacyPropertyDecorator = !DEV
? emptyDecoratorFn
: setPropertyStashVar1WithImplicitVisible('unit');

Expand Down
Loading