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:
Alezia Kurdis 2020-09-30 23:55:46 -04:00 committed by GitHub
parent 64ad0b5afb
commit 1d7f9554ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
};