fix: entitiy structure
This commit is contained in:
parent
5f43591176
commit
7ddeea6efb
|
@ -7,19 +7,19 @@ export default class EntityListView extends Container {
|
|||
this.entityList = entityList;
|
||||
entityList.on('entityAdded', this.onListEntityAdded, this);
|
||||
entityList.on('entityRemoved', this.onListEntityRemoved, this);
|
||||
for (let i = 0; i < entityList.entities.length; i++) {
|
||||
this.onListEntityAdded(entityList.entities[i]);
|
||||
}
|
||||
Object.values(entityList.entities).forEach((entity) => {
|
||||
this.onListEntityAdded(entity);
|
||||
});
|
||||
}
|
||||
|
||||
onListEntityAdded(entity) {
|
||||
if (entity.is('visible')) {
|
||||
if (entity.is('Visible')) {
|
||||
this.addChild(entity.container);
|
||||
}
|
||||
}
|
||||
|
||||
onListEntityRemoved(entity) {
|
||||
if (entity.is('visible')) {
|
||||
if (entity.is('Visible')) {
|
||||
this.removeChild(entity.container);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user