This is indeed close the order that things take place in that specific case (async loading + immediately disabling the gameobject). More specifically:
– The GameObject with the graph is instantiated.
– The Graph begins async loading (in Awake).
– The GameObject is disabled.
– The Graph async loading is completed.
– The Graph starts running (if “On Enable” is “Enable Behaviour”).
Within the Awake call of the GraphOwner, the graph is initialized and is loaded async. When the async load is finished, then the graph is started, by which point you have already disabled the gameobject. However, the graph is started only if the “On Enable” option on the inspector, is set to “Enable Behaviour”.
With that said, what I would suggest would be to change the “On Enable” option on the FSMOwner inspector to “Do Nothing”. As such, the graph will not automatically start, but you will instead need to call “owner.EnableBehaviour”, which can be done together when for example you enable the gameobject itself (using the pooled object).
Please let me know if that solution works for you, or if maybe we can try find another solution 🙂
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.