cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

Normal class use ccclass data is not stored。

Open smallmain opened this issue 1 year ago • 1 comments

Cocos Creator version

3.7.1

System information

Mac

Issue description

@ccclass
export class A {
    // ...
}

@ccclass
export class B extends Component {
    @property(A)
    a: A = new A();
}

There will be no error reporting in this way, but if the B component is mounted on the node, the A data will not be serialized and saved.

If you write like this: ccclass("A"), then the data can be stored normally.

If this is by design, then there should be print an error.

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response

smallmain avatar Mar 11 '23 01:03 smallmain

Yes, referring to the 2.x approach, if it's a ccclass it shouldn't ignore the class name if it doesn't inherit from Component, and should give a warning.

jareguo avatar Dec 07 '23 08:12 jareguo