1. 程式人生 > 其它 >Cocos Creator 迴圈呼叫導致的報錯

Cocos Creator 迴圈呼叫導致的報錯

技術標籤:javapythonjsbugjavascript

cocos迴圈呼叫導致的報錯。

我在Role的constructor裡呼叫了一個單例。

然後單例的一個方法裡呼叫了new Role(),導致這個報錯。

Failed to `new Role()` under the hood, TypeError: Cannot read property 'ins' of undefined
Please specifiy a default value for "Role.roleAnim" at its declaration:
Please specifiy a default value for "Role.weaponAnim" at its declaration: