-
Notifications
You must be signed in to change notification settings - Fork 0
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
event for when a component/node is fully loaded, active and actually in an active graph, similar to other engines "start" function/event #34
Comments
When FUDGE loads a graph, it's fully created and stored in memory, visible or not. So nodes get deserialized and the graph instantiaed. So those events are properly sent. But what does "created/visible/active ingame" actually mean?
|
Unity documentation states: I would say it's called before a node gets rendered, but only once and only if the script is active. Here are my thoughts on the matter: Then we have the |
I understand that these events are sent as they were intended, hence why I'm asking for a new one that fulfills the need i described. I'm with Jonas on closing in on the actual moment that the event should fire.
all of the above combined is what i think I'm looking for. So out of your suggestions I think the closest one is
Assuming "in a scene" refers to a graph that's currently loaded in a viewport and "append" means both adding new instance and initializing the scene with the graph.
We could call it "START" or "READY" or "NODE_VISIBLE_AND_FULLY_LOADED" or whatever else describes it best.
This is another confusing matter. What is loaded and/or activated/processed when? I am still trying to grasp at what point what is loaded and activated, so I can only initialize the things I actually need at the moment and not process literally everything. A graph instance that is only every used to dynamically create objects doesn't need to be loaded and processed all the time. I currently can't think of a situation where I'd want to process a graph or anything related to the graph without that graph being actively rendered and being part of the current game. |
I'm struggling with this problem pretty much every time I'm writing a ComponentScript that needs to initialize itself somehow.
What Event to use to know that the component is attached to a node that is in an actively loaded graph, with all other components and children deserialized?
I've tried various other events in the past, but they all have side effects or need special extra steps.
My current workaround is waiting for NODE_DESERIALIZED before I can attach to node events (but this also fires when the graph is intially loaded from the resources, not just when it's created/visible/active ingame). Then attaching a GRAPH_INSTANTIATED listener to the node, after which I actually can assume that everything i want is loaded.
Oh and of course I always need to add the "Don't do this in the editor" boilerplate as well.
The text was updated successfully, but these errors were encountered: