Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make a ondestroy ? #271

Open
jeromeetienne opened this issue Mar 11, 2013 · 3 comments
Open

make a ondestroy ? #271

jeromeetienne opened this issue Mar 11, 2013 · 3 comments

Comments

@jeromeetienne
Copy link
Owner

good use case, no need for this._callback. use the js closure all the way

    var callback    = world.loop().hook(function(){
        cubeCamera.updateCubeMap( world.tRenderer(), world.tScene() );
    });

    sphere.on('destroy', function(){
        world.loop().unhook(callback)
     })
@jeromeetienne
Copy link
Owner Author

and encourage people to call destroy

@jeromeetienne
Copy link
Owner Author

same for .add/remove ?

@jeromeetienne
Copy link
Owner Author

Some localise experimentation, in various object where i dispatch 'destroy on destructor

Not inheritance infolved

Works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant