新增Debug辅助Insist

This commit is contained in:
yhh
2021-01-18 19:54:41 +08:00
parent eca9ba7b82
commit 3e182db019
13 changed files with 163 additions and 67 deletions

View File

@@ -145,12 +145,9 @@ module es {
* @param component
*/
public removeSceneComponent(component: SceneComponent) {
if (!new linq.List(this._sceneComponents).contains(component)) {
console.warn(`SceneComponent${component}不在SceneComponents列表中!`);
return;
}
new linq.List(this._sceneComponents).remove(component);
const sceneComponentList = new linq.List(this._sceneComponents);
Insist.isTrue(sceneComponentList.contains(component), `SceneComponent${component}不在SceneComponents列表中!`);
sceneComponentList.remove(component);
component.onRemovedFromScene();
}