// // oceanZoneScript.js // // Created by Rebecca Stankus on 07/18/2018. // Copyright 2018 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // (function() { var _this; var AUDIO_VOLUME_LEVEL = 1; var SOUND = SoundCache.getSound(Script.resolvePath('sounds/underwater.wav?3')); var AvatarCounter = function() { _this = this; }; AvatarCounter.prototype = { injector: null, preload: function(entityID) { _this.entityID = entityID; _this.position = Entities.getEntityProperties(_this.entityID, 'position').position; _this.injector = Audio.playSound(SOUND, { position: _this.position, volume: AUDIO_VOLUME_LEVEL, loop: false }); }, unload: function() { if (_this.injector) { _this.injector.stop(); } } }; return new AvatarCounter; });