no water sound

This commit is contained in:
ericrius1 2016-03-08 15:46:55 -08:00
parent 451856ae67
commit bcd8d8fb30
2 changed files with 5 additions and 25 deletions

View file

@ -33,9 +33,6 @@
max: 1000
};
_this.canCreateFlower = true;
_this.flowersBloomingSound = SoundCache.getSound("https://s3-us-west-1.amazonaws.com/hifi-content/eric/Sounds/flowersBlooming.wav");
_this.soundPlaying = false;
_this.BLOOM_VOLUME = 0.4;
};
@ -60,16 +57,7 @@
flower.grow();
});
if (!_this.soundPlaying) {
_this.position = Entities.getEntityProperties(_this.entityID, "position").position;
_this.soundPlaying = true;
_this.bloomSoundInjector = Audio.playSound(_this.flowersBloomingSound, {position: _this.position, volume: _this.BLOOM_VOLUME});
}
},
stopWatering: function() {
_this.bloomSoundInjector.stop();
_this.soundPlaying = false;
},
createFlower: function(position, surfaceNormal) {
@ -135,15 +123,7 @@
}
}
};
},
unload: function() {
if (_this.bloomSoundInjector) {
_this.bloomSoundInjector.stop();
delete _this.bloomSoundInjector;
}
}
};
// entity scripts always need to return a newly constructed object of our type

View file

@ -129,10 +129,10 @@ var waterSpout = Entities.addEntity({
});
function cleanup() {
// Entities.deleteEntity(plant);
// Entities.deleteEntity(bowl);
// Entities.deleteEntity(waterCan);
// Entities.deleteEntity(waterSpout);
Entities.deleteEntity(plant);
Entities.deleteEntity(bowl);
Entities.deleteEntity(waterCan);
Entities.deleteEntity(waterSpout);
}