Query about the ActionScheduler

I am working through the lecture https://www.gamedev.tv/courses/637539/lectures/11879281 and i don’t quite understand why the action is being canceled when we call CancelCurrentAction()
Since we are passing in a null value to StartAction, wouldn’t this mean that the currentAction.Cancel() never gets called, since that method is only being called in the case that currentAction != null.

Since we are setting currentAction to null, shouldn’t it technically skip the if statement which actually calls the Cancel() methods?

Passing a null value to StartAction still forces StartAction to cancel any current action.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms