public override void FinishUsing(bool cancel) { CurrentAction.EndAction(); ResetObjectState(cancel); void ResetAction() { SpriteControler.Instance.ChangeSortingOrder(0); GetComponent <SpriteRenderer>().sortingOrder = 0; } PlayerAnimationHelper.ResetAnimations(); PlayerCommands.WalkBackToLastPosition(ResetAction); PlayerCommands.JumpOff(0, action); void action() => SpriteControler.Instance.ChangeSortingOrder(0); }