-
Notifications
You must be signed in to change notification settings - Fork 41
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
Extensions for GameObject, Transform, and String to provide convience methods #416
Conversation
…type error if needed
…improve readability of code or force null result to be a bool instead
… instance of any one of the given components
… the given components.
…ts in any of its children.
… component. Intended to improve readability or force null result to a bool if needed
… of the child object it is attached to.
…new extension methods using System
Co-authored-by: Maximilian Schmöcker <[email protected]>
…move redundant method
…bject.GetComponent(name)) instead though?
I've pushed a new set of changes that hopefully incorporate the feedback you gave. I'm not sure that the way I rewrote HasAllComponents to avoid null checks is the best way though. Edit: I did some more reading on MonoBehavior and how Unity handles implicitly casting them to a bool, so I removed the counter in HasAllComponents to optimize it a bit more. |
…ck instead of counter
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.
Looks good, thanks for the extensions
I had originally intended to break these into a few smaller PRs but since the goal is a release this weekend I merged them into a single PR. In general each commit corresponds to a set of related extension methods for each class and explains the rationale behind adding those methods, so that it's hopefully easier to accept/reject whatever subset of extensions are judged to be appropriate for Jotunn.