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

mod: Component and SceneModule .add .remove #377

Merged
merged 1 commit into from
Apr 25, 2018
Merged

mod: Component and SceneModule .add .remove #377

merged 1 commit into from
Apr 25, 2018

Conversation

BrookShuihuaLee
Copy link
Contributor

No description provided.

@BrookShuihuaLee
Copy link
Contributor Author

#376

this.children.splice(this.children.indexOf(object), 1);
},
_setScene(scene) {
this.children = scene[SYMBOL_CHILDREN_FOR_SCENE] = scene[SYMBOL_CHILDREN_FOR_SCENE] || []
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR! Everything seems good. Can you explain me why do we use Symbol here? And I'll merge it 😀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scene is a THREE.Scene object. We need store this.children in the object. If we use scene._varName = this.children, there is a risk that the three.js team may use _varName in THREE.Scene later. But in general, Symbol is safe.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BrookShuihuaLee Ok, thanks for explanation! Also, could you contact me in discord for further cooperation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sasha240100 ok, i've sent you a friend request 😄

@sasha240100 sasha240100 merged commit beb1ed9 into WhitestormJS:dev Apr 25, 2018
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

Successfully merging this pull request may close these issues.

2 participants