Skip to content
Snippets Groups Projects
Commit 0fe107a5 authored by netpro2k's avatar netpro2k
Browse files

Add support for naming lifecycle-checkers

parent 4a377266
No related branches found
No related tags found
No related merge requests found
AFRAME.registerComponent("lifecycle-checker", { AFRAME.registerComponent("lifecycle-checker", {
schema: { schema: {
name: { type: "string" },
tick: { default: false } tick: { default: false }
}, },
init: function() { init: function() {
console.log("init", this.el); this.log("init");
}, },
update: function() { update: function() {
console.log("update", this.el); this.log("update");
}, },
tick: function() { tick: function() {
if (this.data.tick) { if (this.data.tick) {
console.log("tick", this.el); this.log("tick");
} }
}, },
remove: function() { remove: function() {
console.log("remove", this.el); this.log("remove");
}, },
pause: function() { pause: function() {
console.log("pause", this.el); this.log("pause");
}, },
play: function() { play: function() {
console.log("play", this.el); this.log("play");
},
log: function(method) {
console.info(`lifecycle-checker:${this.data.name} ${method}`);
} }
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment