mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:17:02 +02:00
added Entities.isLoaded
This commit is contained in:
parent
bcc058ba5f
commit
4ae3c67493
1 changed files with 19 additions and 0 deletions
|
@ -570,6 +570,25 @@ var toolBar = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
entityID = Entities.addEntity(properties);
|
entityID = Entities.addEntity(properties);
|
||||||
|
|
||||||
|
// Make sure the entity is loaded before we try to figure out
|
||||||
|
// it's dimensions.
|
||||||
|
var MAX_LOADED_CHECKS = 10;
|
||||||
|
var LOADED_CHECK_INTERVAL = 200;
|
||||||
|
var isLoadedCheckCount = 0;
|
||||||
|
var entityIsLoadedCheck = function() {
|
||||||
|
isLoadedCheckCount++;
|
||||||
|
if (isLoadedCheckCount === MAX_LOADED_CHECKS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (EntityisLoaded(entityID)) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
Script.setTimeout(entityIsLoadedCheck, LOADED_CHECK_INTERVAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Script.setTimeout(entityIsLoadedCheck, LOADED_CHECK_INTERVAL);
|
||||||
|
|
||||||
SelectionManager.addEntity(entityID, false, this);
|
SelectionManager.addEntity(entityID, false, this);
|
||||||
SelectionManager.saveProperties();
|
SelectionManager.saveProperties();
|
||||||
pushCommandForSelections([{
|
pushCommandForSelections([{
|
||||||
|
|
Loading…
Reference in a new issue