-
Notifications
You must be signed in to change notification settings - Fork 409
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
TryFindComponentOnEntityContainerOrParent no fail please #5322
base: master
Are you sure you want to change the base?
TryFindComponentOnEntityContainerOrParent no fail please #5322
Conversation
Isn't the trycomp just equivalent to the old resolve? Unless people are passing in components via the ref? I have no idea why this method even takes in a ref comp |
yeah shouldnt foundComponent be out instead of ref |
Agreed, I switched it to out and tested that it works recursively as expected. Fortunately I think I'm the only person who has tried to use this on content so there's nothing to fix! |
I have no idea why it was using ref. I don't think there's any uses of the method on content, probably because of its scrungliness, and the method that returns all found parent components instead of the first one doesn't use ref and also uses trycomp instead. As for if they're functionally different, the resolve throws an assert if any of the parents while recursing don't have the component, which is no good here. Also as ref it required you to pass a ref, which is not needed imo, and unintuitive. |
Bump. |
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.
This is a minor breaking change which I'd rather not merge. I do get that out
makes more sense but what's done is done, it should be possible to implement the function regardless.
This reverts commit 54f4a6d.
Hokay, made it ref again to avoid the breaky. |
TryFindComponentOnEntityContainerOrParent
would fail trying to Resolve on parents that don't have the component its searching for. This prevents that by changing the Resolve to TryComp.