In the StartAction method wouldn’t this be a better code solution??? the way Sam does it make’s it a problematic in Rider. It calls it a resource dependent and errors. So I refactored to the below code.
public void StartAction(IAction action)
{
if (currentAction == action) return;
currentAction?.Cancel();
currentAction = action;
}