public override void execute(int deltaX, int deltaY, GameObject receiver) { if (receiver.TryGetComponent(out piece)) { piece.onMoveInput(deltaX, deltaY); formerX = curX; formerY = curY; curX += deltaX; curY += deltaY; } }
public override void undo() { piece?.onMoveInput(formerX - curX, formerY - curY); }