Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Components): simplify getting components and child components
The `GetComponentsInChildren` method will also return any types found on the current object as well so it's not required to do a `GetComponents` to affect the current object and then followed by `GetComponentsInChildren` to affect the child objects. `GetComponentsInChildren` is enough to deal with all current object types and all child types as well. It's inefficient to make the call twice and update the same object in both calls. There are still occasions where a check to see if the item exists on the current object using `GetComponent` is valid, because it it a cheaper call to execute and if the object contains the component then doing the more expensive `GetComponentInChildren` is not required to be made.
- Loading branch information
1 parent
6a480a0
commit 338508a
Showing
6 changed files
with
21 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters