CocosSharp
CocosSharp copied to clipboard
RunActionAsync and RunActionsAsync does not accept CancellationToken
Currently there is no way to cancel a running Action. Suppose we did this:
public async Task SlideUp(CancellationToken ct) {
var state = await RunActionAsync(new CCMoveBy(2f, new CCPoint(0, 100)));
}
You can't get the state so you can't call StopAction in a cancellation token Register call.
It'd be nice to either allow passing in a token:
RunActionAsync(action, token)
Or (ick, but easy) pass the ActionState back as an out parameter so we can manually Register what we want to happen.
Make sense? Need a better example?