I will look into adding an explicit Resume callback. The problem with that though, would be that if I do, I will then also have to remove the OnExecute from being called when the action resumes (which is what happens now), and that might create problems with backwards compatibility, so I will have to make sure this does not happen 🙂
Until that is done though, you can do something like this for example:
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
usingNodeCanvas.Framework;
usingParadoxNotion.Design;
namespaceNodeCanvas.Tasks.Actions{
publicclassExample:ActionTask{
privateboolpaused;
protectedoverridevoidOnExecute(){
if(paused){
paused=false;
//resume code...
return;
}
//normal code...
}
protectedoverridevoidOnPause(){
paused=true;
}
}
}
Let me know what you think.
Thank you!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.