The onFinish callback in Graph.cs is invoked regardless of whether the GraphOwner completes playing or is stopped by calling StopBehaviour().
this causes trouble as we use onFinish callback to trigger loading the next level and I don’t want the load to happen if it’s stopped explicitly.
1
2
3
4
5
6
7
8
9
///Stop the current running graph
publicvoidStopBehaviour(){
if(graph!=null){
graph.Stop();// <---- THIS DOES NOT PASS success STATE TO Graph.Stop, CAUSING onFinish(success) TO ALWAYS HAPPEN.
if(onOwnerBehaviourStateChange!=null){
onOwnerBehaviourStateChange(this);
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
///Stops the graph completely and resets all nodes.
Hmm… I think that adding an optional bool parameter for StopBehaviour like in your first suggestion, makes total sense and I can definitely add this in the next version officially:
1
2
3
4
5
6
7
8
9
10
11
///Stop the current running graph
publicvoidStopBehaviour(boolsuccess=true){
if(graph!=null){
graph.Stop(success);
if(onOwnerBehaviourStateChange!=null){
onOwnerBehaviourStateChange(this);
}
}
}
Would that work for you?
I could of course also add your second suggestion ClearOnFinishActions() if required 🙂
Hey Gavalakis, thanks for your response. Adding an optional boolean definitely works. It’d be awesome if you could add clearOnFinishActions too, if that doesn’t go against your design.
Are you planning on releasing the new version any time soon? 🙂
The new version has just gone live recently!
It does include your first suggestion (optional boolean parameter), but didn’t manage to squeeze in the ClearOnFinishActrions since I did send the new version before I had the chance to check on your new reply above 🙂