Sorry for the late reply due to summer vacation and no problem! 🙂
Hmm… Right now, when a state exits, EndAction is called on all ActionTasks assigned to the state. However, if the ActionTask is already stopped, the callback OnStop is not called again (to avoid calling it multiple times). I could add something like “OnForcedStop” which will be called regardless whether or not the action is still running, which will result in it being called for example, when the FSM state exists as well.
Here are the changes I’ve made if you want to please try out and let me know if that indeed works for you the way you want:
Please open up ActionTask.cs and change lined #128-130 to be like this:
1
2
3
4
5
6
if(status!=Status.Running){
OnForcedStop();
return;
}
Then also, of course add a virtual method at the end like so:
1
2
3
4
///Called if EndAction is called while the action was not running anyways. Could be called multiple times.
virtualprotectedvoidOnForcedStop(){}
Let me know how that works for you.
Thanks!
Join us on Discord: https://discord.gg/97q2Rjh
Login
Register
By registering on this website you agree to our Privacy Policy.