mirror of
https://github.com/overte-org/overte.git
synced 2025-06-05 02:20:34 +02:00
35 lines
No EOL
966 B
JavaScript
35 lines
No EOL
966 B
JavaScript
|
|
(function() {
|
|
var _this;
|
|
Script.include("../libraries/utils.js");
|
|
VRVJSoundEntity = function() {
|
|
_this = this;
|
|
|
|
};
|
|
|
|
VRVJSoundEntity.prototype = {
|
|
playSound: function() {
|
|
// _this.soundInjector = Audio.playSound(_this.clip, {position: _this.position, volume: 1.0});
|
|
},
|
|
|
|
preload: function(entityID) {
|
|
_this.entityID = entityID;
|
|
_this.position = Entities.getEntityProperties(_this.entityID, "position").position;
|
|
_this.userData = getEntityUserData(_this.entityID);
|
|
_this.clip = SoundCache.getSound(_this.userData.soundURL);
|
|
|
|
},
|
|
|
|
unload: function() {
|
|
if (_this.soundInjector) {
|
|
_this.soundInjector.stop();
|
|
delete _this.soundInjector;
|
|
}
|
|
}
|
|
|
|
|
|
};
|
|
|
|
// entity scripts always need to return a newly constructed object of our type
|
|
return new VRVJSoundEntity();
|
|
}); |