Skip to content

Instantly share code, notes, and snippets.

@huffman
Last active January 25, 2017 20:31
Show Gist options
  • Save huffman/e8e00c85e95e6af79f03e5e3ee1de323 to your computer and use it in GitHub Desktop.
Save huffman/e8e00c85e95e6af79f03e5e3ee1de323 to your computer and use it in GitHub Desktop.
var i = 0;
var testProps = {};
var self = null;
(function() {
return {
preload: function(entityID) {
self = this;
print("Preload 2: ", entityID);
this.entityID = entityID;
this.intervalID = Script.setInterval(this.update, 1000);
},
unload: function() {
print("Unload 2: ", this.entityID);
Script.clearInterval(this.intervalID);
},
update: function(dt) {
testProps = { text: i}
Entities.editEntity(self.entityID, testProps);
i++;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment