mirror of
https://github.com/lubosz/overte.git
synced 2025-04-17 06:46:37 +02:00
Add audio feedback on Duplicate
Add an audio feedback mechanism to play confirmation or rejection sound on specific actions that are not visually detectable. here for "Duplicate" (mainly for the HMD use case where the new entity is generated at the exact same position)
This commit is contained in:
parent
64ad0b5afb
commit
1d7f9554ce
1 changed files with 8 additions and 0 deletions
|
@ -319,6 +319,7 @@ SelectionManager = (function() {
|
|||
that.addChildrenEntities(originalEntityID, entitiesToDuplicate, entityHostTypes[i].entityHostType);
|
||||
}
|
||||
|
||||
var hasItFailed = false;
|
||||
// duplicate entities from above and store their original to new entity mappings and children needing re-parenting
|
||||
for (var i = 0; i < entitiesToDuplicate.length; i++) {
|
||||
var originalEntityID = entitiesToDuplicate[i];
|
||||
|
@ -365,6 +366,8 @@ SelectionManager = (function() {
|
|||
duplicatedChildrenWithOldParents[newEntityID] = properties.parentID;
|
||||
}
|
||||
originalEntityToNewEntityID[originalEntityID] = newEntityID;
|
||||
} else {
|
||||
hasItFailed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -383,6 +386,11 @@ SelectionManager = (function() {
|
|||
}
|
||||
});
|
||||
|
||||
if (!hasItFailed) {
|
||||
audioFeedback.confirmation();
|
||||
} else {
|
||||
audioFeedback.rejection();
|
||||
}
|
||||
return duplicatedEntityIDs;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue