From bb18366cbd3d31154aafa61833becf96bd1c96cd Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Thu, 17 Mar 2016 10:58:24 -0700 Subject: [PATCH] clean and log --- .../DomainContent/Home/fishTank/wrapper.js | 1 + .../Home/growingPlant/wrapper.js | 4 +++ .../DomainContent/Home/pingPongGun/wrapper.js | 1 + .../DomainContent/Home/reset.js | 30 +++++++++---------- .../DomainContent/Home/tiltMaze/wrapper.js | 1 + .../DomainContent/Home/whiteboard/wrapper.js | 1 + 6 files changed, 23 insertions(+), 15 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js b/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js index d60989a95a..19fa7f1389 100644 --- a/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js @@ -395,6 +395,7 @@ FishTank = function(spawnPosition, spawnRotation) { function cleanup() { + print('TANK CLEANUP!') Entities.deleteEntity(fishTank); Entities.deleteEntity(tankBase); Entities.deleteEntity(bubbleSystem); diff --git a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js index bc69aff5ce..062931883e 100644 --- a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js @@ -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); diff --git a/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js b/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js index 9cf1b78d99..6c7d5b0c49 100644 --- a/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js @@ -63,6 +63,7 @@ _PingPongGun = function(spawnPosition, spawnRotation) { }); function cleanup() { + print('PING PONG CLEANUP!') Entities.deleteEntity(pingPongGun); } diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 8664019848..b3a122bdf4 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -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(); }) }, diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js index ceb43ca1ac..bb85a89b6b 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js @@ -273,6 +273,7 @@ TiltMaze = function(spawnPosition, spawnRotation) { createAll(); function cleanup() { + print('MAZE CLEANUP') Entities.deleteEntity(tiltMaze); Entities.deleteEntity(ball); Entities.deleteEntity(ballSpawningAnchor); diff --git a/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js b/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js index ec95c1058a..673bd59498 100644 --- a/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js @@ -231,6 +231,7 @@ Whiteboard = function(spawnPosition, spawnRotation) { } function cleanup() { + print('WHITEBOARD CLEANUP') Entities.deleteEntity(whiteboard); Entities.deleteEntity(whiteboardFrontDrawingSurface); Entities.deleteEntity(whiteboardBackDrawingSurface);