35 lines
933 B
JavaScript
35 lines
933 B
JavaScript
//
|
|
// Copyright 2016 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 soundURL ='http://hifi-content.s3.amazonaws.com/caitlyn/production/tools/oilcanMix.wav';
|
|
var soundInjector = null;
|
|
|
|
this.preload = function(entityID) {
|
|
soundInjector = SoundCache.getSound(soundURL);
|
|
};
|
|
|
|
this.startNearGrab = function(entityID, mouseEvent) {
|
|
print("Oil can event");
|
|
Audio.playSound(soundInjector, {
|
|
position: MyAvatar.position,
|
|
volume: 1
|
|
});
|
|
//Script.setTimeout(function(){},2555);
|
|
};
|
|
|
|
|
|
this.unload = function() {
|
|
if (soundInjector !== undefined && soundInjector.isPlaying) {
|
|
soundInjector.stop();
|
|
soundInjector = undefined;
|
|
}
|
|
};
|
|
|
|
});
|
|
|