moved spraycan into toybox folder, and added spraypaint sound

This commit is contained in:
ericrius1 2015-09-23 12:08:28 -07:00
parent 9818e2549c
commit c7cb77a6ab
2 changed files with 9 additions and 1 deletions

View file

@ -6,6 +6,8 @@
GRAB_FRAME_USER_DATA_KEY = "grabFrame";
this.userData = {};
this.spraySound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/sprayPaintSound.wav");
var TIP_OFFSET_Z = 0.14;
var TIP_OFFSET_Y = 0.04;
@ -101,12 +103,18 @@
},
lifetime: 50, //probably wont be holding longer than this straight
});
this.sprayInjector = Audio.playSound(this.spraySound, {
position: this.properties.position,
volume: 0.1
});
}
this.letGo = function() {
this.activated = false;
Entities.deleteEntity(this.paintStream);
this.paintStream = null;
this.sprayInjector.stop();
}
this.reset = function() {

View file

@ -363,7 +363,7 @@ function createDoll(position) {
}
function createSprayCan(position) {
var scriptURL = Script.resolvePath("../entityScripts/sprayPaintCan.js");
var scriptURL = Script.resolvePath("entityScripts/sprayPaintCan.js");
var modelURL = "https://hifi-public.s3.amazonaws.com/eric/models/paintcan.fbx";
var entity = Entities.addEntity({