var Class = require('../utils/Class'); var Components = require('./components'); var GameObject = new Class({ initialize: function GameObject(scene, type){ this.scene = scene; this.type = type; this.name = ''; this.active = true ; this.tabIndex = -1; this.parent; this.renderMask = 15; this.renderFlags = 15; this.cameraFilter = 0; this.input = null ; this.scene.sys.sortChildrenFlag = true ; } , setActive: function (value){ this.active = value; return this; } , setName: function (value){ this.name = value; return this; } , setInteractive: function (shape, callback){ this.scene.sys.inputManager.enable(this, shape, callback); return this; } , update: function (){ } , toJSON: function (){ return Components.ToJSON(this); } , willRender: function (){ return (this.renderMask === this.renderFlags); } , destroy: function (){ if (this.parent) { this.parent.remove(this); } if (this.input) { _AN_Call_clear('clear', this.scene.sys.inputManager, this); } this.active = false ; this.scene = undefined; } } ); module.exports = GameObject;