Hello! Maybe I am wrong but there is no function for initialization that is called once when the graph is loaded for “heavy” stuff..
As OnInit() is called once first time the node is active this can produce the needed allocations or heavy stuff in the middle of the game which is not optimal.
Graph.cs
1
2
3
4
5
6
7
virtual protectedvoidOnGraphInitialize()
{
// Add OnLoaded callback for tasks.
foreach(vartask inallTasks)
task.OnLoaded();
}
Task.cs
1
2
3
4
5
6
7
8
9
10
11
virtual protectedstringOnInit(){returnnull;}
/// <summary>This is called once when the graph is loaded.</summary>
virtual publicvoidOnLoaded(){}
///<summary>Called once the first time task is created</summary>
Indeed there is no call in Tasks for when the graph is initialized. I will add something for this in a future update though.
Thank you for your suggestion 🙂