spray can tweaks

This commit is contained in:
ericrius1 2015-09-15 16:48:28 -07:00
parent 9648f56062
commit da208526cc
2 changed files with 7 additions and 7 deletions

View file

@ -98,9 +98,8 @@
green: 20, green: 20,
blue: 150 blue: 150
}, },
lifetime: 500, //probably wont be holding longer than this straight lifetime: 50, //probably wont be holding longer than this straight
}); });
} }
this.letGo = function() { this.letGo = function() {
@ -228,7 +227,6 @@
this.unload = function() { this.unload = function() {
Script.update.disconnect(this.update); Script.update.disconnect(this.update);
Entities.deleteEntity(this.paintStream);
this.strokes.forEach(function(stroke) { this.strokes.forEach(function(stroke) {
Entities.deleteEntity(stroke); Entities.deleteEntity(stroke);
}); });

View file

@ -9,7 +9,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//Just temporarily using my own bucket here so others can test the entity. Once PR is tested and merged, then the entity script will appear in its proper place in S3, and I wil switch it //Just temporarily using my own bucket here so others can test the entity. Once PR is tested and merged, then the entity script will appear in its proper place in S3, and I wil switch it
var scriptURL = "https://hifi-public.s3.amazonaws.com/eric/scripts/sprayPaintCan.js?=v1"; var scriptURL = "https://hifi-public.s3.amazonaws.com/eric/scripts/sprayPaintCan.js?=v3";
var modelURL = "https://hifi-public.s3.amazonaws.com/eric/models/paintcan.fbx"; var modelURL = "https://hifi-public.s3.amazonaws.com/eric/models/paintcan.fbx";
var sprayCan = Entities.addEntity({ var sprayCan = Entities.addEntity({
@ -26,12 +26,14 @@ var sprayCan = Entities.addEntity({
collisionsWillMove: true, collisionsWillMove: true,
shapeType: 'box', shapeType: 'box',
script: scriptURL, script: scriptURL,
// gravity: {x: 0, y: -0.5, z: 0}, gravity: {x: 0, y: -0.5, z: 0},
// velocity: {x: 0, y: -1, z: 0} velocity: {x: 0, y: -1, z: 0}
}); });
function cleanup() { function cleanup() {
Entities.deleteEntity(sprayCan);
// Uncomment the below line to delete sprayCan on script reload- for faster iteration during development
// Entities.deleteEntity(sprayCan);
} }
Script.scriptEnding.connect(cleanup); Script.scriptEnding.connect(cleanup);