-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
OnCreate invoke after all instances created #607
base: master
Are you sure you want to change the base?
Conversation
You must have done something wrong in your code, because I have tried to replicate your issue and I just cannot replicate it :/ |
This is a logical issue with program execution. For example: There are two GameObjects A and B in the scene. We assume that A is created before B. There is no problem to use "GetComponent" from A in the OnCreate() function of B, but if A want to get a component from B or get the instance of B, there will be fail, because B was not yet created when A called the OnCreate() function. |
Yeah I think I get the gist of it, I just cannot replicate it for some reason... Like I said, it works fine for me... |
And I think I know why I cannot reproduce the error... Yan has updated a lot of code when he went on to create the Asset Manager System, and while he did that, I think he has updated some of the code in Scene.cpp(?) which happens to fix the Hierarchy turning upside-down every time you save! So with the new code the Hierarchy only turns upside-down whenever you run the scenes! That could be it! But don't think that you can settle with just downloading the asset-manager branch and all is good, because you will need to watch the latest VOD on twitch, since Yan hasn't uploaded it yet to youtube! And if you don't know it, the VOD is only up for a total of 60 days on twitch, and it has already been 14 days since he streamed it! Hope this helps 🙂 |
Maybe so. I published this issue last year. I'll look at the current source code again. Thanks for communication. :D |
My pleasure 😄👍 |
I have just found out that I made a slight bummer |
Describe the issue (if no issue has been made)
Here is my modification plan after I pushed this issuse -#606 .
PR impact (Make sure to add closing keywords)
List of related issues/PRs this will solve:
Proposed fix (Make sure you've read on how to contribute to Hazel)
I splited the method "OnCreateEntity(Entity entity)" into "CreateEntity(Entity entity)" and "OnCreateEntities()".
One is to register all instances in the instances map, another one is to invoke their OnCreate() function.
Additional context
Add any other context about the solution here. Did you test the solution on all (relevant) platforms?
If not, create a task list here.