clean and log

This commit is contained in:
James B. Pollack 2016-03-17 10:58:24 -07:00
parent d9526b6506
commit bb18366cbd
6 changed files with 23 additions and 15 deletions

View file

@ -395,6 +395,7 @@ FishTank = function(spawnPosition, spawnRotation) {
function cleanup() {
print('TANK CLEANUP!')
Entities.deleteEntity(fishTank);
Entities.deleteEntity(tankBase);
Entities.deleteEntity(bubbleSystem);

View file

@ -8,6 +8,7 @@
// This entity script handles the logic for growing a plant when it has water poured on it
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js?v1" + Math.random().toFixed(2));
var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js?v2" + Math.random().toFixed());
Plant = function(spawnPosition, spawnRotation) {
@ -57,6 +58,8 @@ Plant = function(spawnPosition, spawnRotation) {
parentID: bowl
});
print('CREATED PLANT:: '+ plant)
var WATER_CAN_MODEL_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/waterCan.fbx?v1" + Math.random();
var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
@ -132,6 +135,7 @@ Plant = function(spawnPosition, spawnRotation) {
});
function cleanup() {
print('PLANT CLEANUP!')
Entities.deleteEntity(plant);
Entities.deleteEntity(bowl);
Entities.deleteEntity(waterCan);

View file

@ -63,6 +63,7 @@ _PingPongGun = function(spawnPosition, spawnRotation) {
});
function cleanup() {
print('PING PONG CLEANUP!')
Entities.deleteEntity(pingPongGun);
}

View file

@ -104,7 +104,7 @@
},
createDynamicEntities: function() {
Script.include(utilsPath);
Script.include(fishTankPath);
Script.include(tiltMazePath);
@ -116,10 +116,10 @@
x: 1098.9254,
y: 460.5814,
z: -79.1103
},{
x:0,
y:152,
z:0
}, {
x: 0,
y: 152,
z: 0
});
var tiltMaze = new TiltMaze({
@ -132,10 +132,10 @@
x: 1104,
y: 460.5,
z: -77
},{
x:0,
y:-133,
z:0
}, {
x: 0,
y: -133,
z: 0
});
var myPlant = new Plant({
@ -148,13 +148,11 @@
x: 1101.2123,
y: 460.2328,
z: -65.8513
},
{
}, {
x: 97.3683,
y: 179.0293,
z: 89.9698
}
);
});
@ -163,9 +161,9 @@
dynamicEntities.push(whiteboard);
dynamicEntities.push(myPlant);
dynamicEntities.push(pingPongGun);
//v2.0
// var musicBox = new MusicBox();
// var cuckooClock = new CuckooClock();
@ -180,6 +178,7 @@
return;
}
dynamicEntities.forEach(function(dynamicEntity) {
print('CLEANING UP A DYNAMIC')
dynamicEntity.cleanup();
})
},
@ -258,6 +257,7 @@
return;
}
kineticEntities.forEach(function(kineticEntity) {
print('CLEANING UP A KINETIC')
kineticEntity.cleanup();
})
},

View file

@ -273,6 +273,7 @@ TiltMaze = function(spawnPosition, spawnRotation) {
createAll();
function cleanup() {
print('MAZE CLEANUP')
Entities.deleteEntity(tiltMaze);
Entities.deleteEntity(ball);
Entities.deleteEntity(ballSpawningAnchor);

View file

@ -231,6 +231,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
}
function cleanup() {
print('WHITEBOARD CLEANUP')
Entities.deleteEntity(whiteboard);
Entities.deleteEntity(whiteboardFrontDrawingSurface);
Entities.deleteEntity(whiteboardBackDrawingSurface);