cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.23k stars 1.94k forks source link

support editorOnly tag for some editor property #14613

Open PPpro opened 1 year ago

PPpro commented 1 year ago

Use Case

class Node {
    /**
     * @editorOnly
     */
    @serializable
    protected _prefab: PrefabInfo | null = null;
}

Problem Description

we need to support an editorOnly tag, so that some properties should export to editor only, they are not public to game developers

related PR: https://github.com/cocos/cocos-engine/pull/14614

Proposed Solution

No response

How it works

No response

Alternatives Considered

none

Additional Information

No response

nianba23 commented 1 year ago

The class also needs to support editorOnly

/**
 * @editorOnly
 */
@ccclass('cc.Light')
export class Light extends Component {

}