bubble update hook

This commit is contained in:
James Pollack 2015-09-10 10:31:17 -07:00
parent 8f77c0b61c
commit dfa43e84bf

View file

@ -28,6 +28,8 @@
blue: 255, blue: 255,
} }
var _t = this;
var properties; var properties;
var checkPositionInterval; var checkPositionInterval;
this.preload = function(entityID) { this.preload = function(entityID) {
@ -36,8 +38,14 @@
// _t.entityID = entityID; // _t.entityID = entityID;
// properties = Entities.getEntityProperties(entityID); // properties = Entities.getEntityProperties(entityID);
// _t.loadShader(entityID); // _t.loadShader(entityID);
Script.update.connect(_t.internalUpdate);
}; };
this.internalUpdate = function() {
properties = Entities.getEntityProperties(_t.entityID)
}
this.loadShader = function(entityID) { this.loadShader = function(entityID) {
setEntityUserData(entityID, { setEntityUserData(entityID, {
"ProceduralEntity": { "ProceduralEntity": {
@ -57,12 +65,13 @@
}; };
this.unload = function(entityID) { this.unload = function(entityID) {
// Script.clearInterval(checkPositionInterval);
// var position = properties.position; Script.update.disconnect(this.internalUpdate);
// this.endOfBubble(position); properties = Entities.getEntityProperties(entityID)
var properties = Entities.getEntityProperties(entityID)
var position = properties.position; var position = properties.position;
//print('UNLOAD PROPS' + JSON.stringify(position)); // this.endOfBubble(position);
print('UNLOAD PROPS' + JSON.stringify(position));
}; };
this.endOfBubble = function(position) { this.endOfBubble = function(position) {