Skip to content

Is it possible to get access to component during start method? #1

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

Closed
TheLouisHong opened this issue Dec 16, 2015 · 3 comments
Closed

Comments

@TheLouisHong
Copy link

Is it even reasonable to ask that or is that a code smell of some sort?

@Thundernerd
Copy link
Owner

If you mean that the components are available when the start method gets executed then yes, they are accessible at that time.
Depending on what version you are using you can also get then in Awake.
Versions below 1.2 have the extendedbehaviour and the extension methods so you can get the components in Awake, Start, OnEnable, whenever you want really.
From 1.2 on there's no extendedbehaviour or extension method anymore so they are only available from when Start gets called.

If you have any other questions feel free to ask!

@TheLouisHong
Copy link
Author

Thank you for making such a nice script and sharing it on GitHub. Don't forget to update your unitypackage file, it wasn't working because I was using an older version of the asset that came from the unitypackage.

@Thundernerd
Copy link
Owner

Thanks, I'll make sure to update it soon!

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

No branches or pull requests

2 participants