-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix dynamically-attached entities not playing due to load conditions (fixes #1383) #1415
Conversation
} | ||
} else { | ||
// To handle elements that are not yet `<a-entity>`s (e.g., templates). | ||
el.addEventListener('nodeready', init.bind(self)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't listen to the nodeready event anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those were leftover from <a-template>
.
@dmarcos r? |
} | ||
|
||
// Entity load. | ||
function entityLoadCallback () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we move this function to the bottom of the function after ANode.prototype.load.call(this, entityLoadCallback, isEntity);
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to? seems more consistent with doing vars-on-top since these functions get hoisted. and readability-wise, it makes sense to want to know what this function is doing in the context of the method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function gets in the way of understanding the main body of the function. I want to see what the function does first and maybe later want to see what happens asynchronously when the entity loads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll change this later in a follow up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function is integral to understanding what the function does though. it's only separated because it's awkward to inline
Description:
Caught this using the template component that dynamically attached entities that also had the template component to dynamically attach entities.
play()
loaded
Changes proposed:
play()
after they are loaded..bind
calls.