Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

WhereIsMyID
Copy link

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:

Impact Issue/PR
Issues this solves 1
Other PRs this solves None

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.

@WhereIsMyID WhereIsMyID changed the title OnCreate invkoe after all instances created OnCreate invoke after all instances created Jan 11, 2023
@VagueLobster
Copy link
Contributor

You must have done something wrong in your code, because I have tried to replicate your issue and I just cannot replicate it :/
I have even tried your "fix" and it does absolutely nothing on my 1-1 copy of little Hazel :(

@WhereIsMyID
Copy link
Author

You must have done something wrong in your code, because I have tried to replicate your issue and I just cannot replicate it :/ I have even tried your "fix" and it does absolutely nothing on my 1-1 copy of little Hazel :(

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.
I hope u can understand the meaning of my above paragraph :)

@VagueLobster
Copy link
Contributor

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...

@VagueLobster
Copy link
Contributor

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 🙂

@WhereIsMyID
Copy link
Author

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

@VagueLobster
Copy link
Contributor

My pleasure 😄👍

@VagueLobster
Copy link
Contributor

VagueLobster commented Jul 24, 2023

Maybe so. I published this issue last year. I'll look at the current source code again. Thanks for communication. :D

I have just found out that I made a slight bummer ☹️It's the VOD from 21 days ago today that is the last little Hazel VOD, sorry about that!

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

Successfully merging this pull request may close these issues.

2 participants