mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-06 02:58:21 +02:00
34 lines
No EOL
955 B
JavaScript
34 lines
No EOL
955 B
JavaScript
(function() {
|
|
|
|
var _this;
|
|
|
|
function BaseBox() {
|
|
_this = this;
|
|
return this;
|
|
}
|
|
|
|
BaseBox.prototype = {
|
|
preload: function(entityID) {
|
|
this.entityID = entityID;
|
|
},
|
|
continueNearGrab: function() {
|
|
var myProps = Entities.getEntityProperties(_this.entityID)
|
|
var results = Entities.findEntities(myProps.position, 2);
|
|
var lid = null;
|
|
results.forEach(function(result) {
|
|
var resultProps = Entities.getEntityProperties(result);
|
|
if (resultProps.name.indexOf('music_box_lid') > -1) {
|
|
lid = result;
|
|
}
|
|
});
|
|
if (lid === null) {
|
|
return;
|
|
} else {
|
|
Entities.callEntityMethod(lid, 'updateHatRotation');
|
|
Entities.callEntityMethod(lid, 'updateKeyRotation');
|
|
}
|
|
}
|
|
}
|
|
|
|
return new BaseBox
|
|
}) |