mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 21:56:26 +02:00
Update editEntitiesWithTag to use static lookup table
This commit is contained in:
parent
1f25ba8f1f
commit
0234747ec3
1 changed files with 12 additions and 6 deletions
|
@ -201,12 +201,18 @@ function deleteEntitiesWithTag(tag) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function editEntitiesWithTag(tag, propertiesOrFn) {
|
function editEntitiesWithTag(tag, propertiesOrFn) {
|
||||||
var entityIDs = findEntitiesWithTag(tag);
|
//var entityIDs = findEntitiesWithTag(tag);
|
||||||
for (var i = 0; i < entityIDs.length; ++i) {
|
var entities = TUTORIAL_TAG_TO_ENTITY_IDS_MAP[tag];
|
||||||
if (isFunction(propertiesOrFn)) {
|
|
||||||
Entities.editEntity(entityIDs[i], propertiesOrFn(entityIDs[i]));
|
debug("Editing tag: ", tag);
|
||||||
} else {
|
if (entities) {
|
||||||
Entities.editEntity(entityIDs[i], propertiesOrFn);
|
for (entityID in entities) {
|
||||||
|
debug("Editing: ", entityID, ", ", propertiesOrFn, ", Is in local tree: ", isEntityInLocalTree(entityID));
|
||||||
|
if (isFunction(propertiesOrFn)) {
|
||||||
|
Entities.editEntity(entityID, propertiesOrFn(entityIDs[i]));
|
||||||
|
} else {
|
||||||
|
Entities.editEntity(entityID, propertiesOrFn);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue