I need to implement the functionality of calling procedures, that start executing immediately.
The paradigm I’ve been using so far is to have the “procedure” as a GameObject with an ActionListPlayer, and the “call” is an action to execute the Play method of the ALP (completes immediately, regardless of how long the actions take), or my ExecuteAction extension if the caller wants to wait for action completion.
In turn, the procedure’s body would be implemented either as a simple list of actions in the ALP, or the ALP object would also contain a BT, and the ALP would contain an “Implemented Action (mp)” over BehaviourTreeOwner.Tick. Using the ALP in both cases is so that the caller does not need to know the implementation details.
The problem I’m facing, and which AFAIK did not exist in the previous version, is that graphs set to do nothing onEnable seem to not be initialized properly – references to global BB variables comes up null.
Any advice on this? Is the seemingly missing initialization a bug? Is there a better way to go about the whole thing?
P.S. cannot use GraphOwnerControl, because it has a one-frame delay.
What do you mean by saying that references to global blackboard variables come up null?
Do you mean that the variable value in runtime results to null, or that in editor it looks like this after a Unity script re-compile:
If the 2nd, then to fix it, please open up GlobalBlackboard.cs and add this piece of code by the end:
1
2
3
4
5
6
7
8
9
10
11
#if UNITY_EDITOR
voidOnValidate(){
if(!allGlobals.Contains(this)){
allGlobals.Add(this);
}
}
#endif
Let me know if that is indeed the issue, or if I misunderstood it.
Thanks.