added some debugging to breakdance toy

This commit is contained in:
Brad Hefta-Gaub 2015-09-09 14:24:52 -07:00
parent 427ed8807b
commit ec93fc1b05

View file

@ -45,14 +45,15 @@
// if the grabData says we're being grabbed, and the owner ID is our session, then we are being grabbed by this interface
if (grabData.activated && grabData.avatarId == MyAvatar.sessionUUID) {
//print("BreakdanceEntity.update() [I'm being grabbed] _this.entityID:" + _this.entityID);
if (!_this.beingGrabbed) {
print("I'm was grabbed... _this.entityID:" + _this.entityID);
// remember we're being grabbed so we can detect being released
_this.beingGrabbed = true;
var props = Entities.getEntityProperties(entityID);
var puppetPosition = getPuppetPosition(props);
breakdanceStart(props.modelURL, puppetPosition);
print("I'm was grabbed...");
} else {
breakdanceUpdate();
}
@ -62,7 +63,7 @@
// if we are not being grabbed, and we previously were, then we were just released, remember that
// and print out a message
_this.beingGrabbed = false;
print("I'm was released...");
print("I'm was released... _this.entityID:" + _this.entityID);
breakdanceEnd();
}
},
@ -73,6 +74,7 @@
// * connecting to the update signal so we can check our grabbed state
preload: function(entityID) {
this.entityID = entityID;
print("BreakdanceEntity.preload() this.entityID:" + this.entityID);
Script.update.connect(this.update);
},
@ -80,6 +82,7 @@
// or because we've left the domain or quit the application. In all cases we want to unhook our connection
// to the update signal
unload: function(entityID) {
print("BreakdanceEntity.unload() this.entityID:" + this.entityID);
Script.update.disconnect(this.update);
},