Event fired after graph is deserialized

Is there any event fired after DeserializeGraphsAdditive? Or if not - is there any workaround for that? I do not want to access it from inside the graph modifier but inside my custom code. Right now subscribing to :

  • AstarPath.OnGraphsUpdated
  • AstarPath.OnPostScan
  • AstarPath.OnLatePostScan
  • AstarPath.OnGraphPostScan

didn’t get called unfortunately when calling DeserializeGraphsAdditive. Any hints?

Hi

If you call DeserializeGraphsAdditive yourself, you can just call whatever code you want after that, can’t you?
There’s no built-in event doing what you want.

I assumed that it has to be something that I am missing simply. Thanks, I’ll handle it myself, but maybe consider adding something like this to a future release?

Would you mind explaining a bit more about your particular use case?

I have a couple of scenes that are made of reusable sub-scenes (actually these are regular unity scenes that are being loaded/unloaded additively). When I load such sub-scene I am also loading serialized nav graph for this part of the level. Because there are multiple places in code (including even custom gameplay flow graph-based solution) when I am calling loading of this sub-scene I just thought it would be easier to subscribe to the astar event since it has plenty of them. I need to know when sub-scene graph has done loading in order to cache some BFS returned nodes.

But if that’s not aligned with your development roadmap, that’s fine. I’ll refactor my code without any issues now that I get it that there is no built-in event available.

1 Like