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() { function cleanup() {
print('TANK CLEANUP!')
Entities.deleteEntity(fishTank); Entities.deleteEntity(fishTank);
Entities.deleteEntity(tankBase); Entities.deleteEntity(tankBase);
Entities.deleteEntity(bubbleSystem); 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 // 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. // Distributed under the Apache License, Version 2.0.
// 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
//
var PLANT_SCRIPT_URL = Script.resolvePath("growingPlantEntityScript.js?v1" + Math.random().toFixed(2)); 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()); var WATER_CAN_SCRIPT_URL = Script.resolvePath("waterCanEntityScript.js?v2" + Math.random().toFixed());
Plant = function(spawnPosition, spawnRotation) { Plant = function(spawnPosition, spawnRotation) {
@ -57,6 +58,8 @@ Plant = function(spawnPosition, spawnRotation) {
parentID: bowl 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 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))); var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
@ -132,6 +135,7 @@ Plant = function(spawnPosition, spawnRotation) {
}); });
function cleanup() { function cleanup() {
print('PLANT CLEANUP!')
Entities.deleteEntity(plant); Entities.deleteEntity(plant);
Entities.deleteEntity(bowl); Entities.deleteEntity(bowl);
Entities.deleteEntity(waterCan); Entities.deleteEntity(waterCan);

View file

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

View file

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

View file

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

View file

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