Пример #1
0
 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;
     }
 }
Пример #2
0
 public override void undo()
 {
     piece?.onMoveInput(formerX - curX, formerY - curY);
 }