mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
Fix the problem that addComponent does not check if the same type of component is allowed to exist at the same time (#13916)
This commit is contained in:
@@ -181,9 +181,9 @@ nodeProto.addComponent = function (typeOrClassName) {
|
||||
throw TypeError(getError(3810));
|
||||
}
|
||||
|
||||
// if (EDITOR && (constructor as typeof constructor & { _disallowMultiple?: unknown })._disallowMultiple) {
|
||||
// this._checkMultipleComp!(constructor);
|
||||
// }
|
||||
if (EDITOR && (constructor as typeof constructor & { _disallowMultiple?: unknown })._disallowMultiple) {
|
||||
this._checkMultipleComp!(constructor);
|
||||
}
|
||||
|
||||
// check requirement
|
||||
|
||||
|
||||
Reference in New Issue
Block a user