mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01: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);
|
||||
|
||||
// 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.saveProperties();
|
||||
pushCommandForSelections([{
|
||||
|
|
Loading…
Reference in a new issue