CocosSharp icon indicating copy to clipboard operation
CocosSharp copied to clipboard

RunActionAsync and RunActionsAsync does not accept CancellationToken

Open Crisfole opened this issue 8 years ago • 0 comments

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?

Crisfole avatar Jan 27 '17 17:01 Crisfole