SHARE
TWEET

Untitled

a guest Feb 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         /// <summary>
  2.         /// Меняет местами передаваемое представление предмета с представлением предмета находящийся в текущей ячейке
  3.         /// </summary>
  4.         /// <param name="itemPresentation">Представление предмета</param>
  5.         public void Swap(ItemPresentation itemPresentation)
  6.         {
  7.             if(itemPresentation == default || _itemPresentation == default)
  8.                 return;
  9.  
  10.             itemPresentation.Cell._itemPresentation = _itemPresentation;
  11.  
  12.             _itemPresentation.transform.SetParent(itemPresentation.Cell.transform);
  13.             _itemPresentation.transform.localPosition = Vector3.zero;
  14.             _itemPresentation.Cell = itemPresentation.Cell;
  15.             _itemPresentation.Cell.IsModified = true;
  16.  
  17.             itemPresentation.transform.SetParent(transform);
  18.             itemPresentation.transform.localPosition = Vector3.zero;
  19.             itemPresentation.Cell = this;
  20.             itemPresentation.Cell.IsModified = true;
  21.  
  22.             _itemPresentation = itemPresentation;
  23.  
  24.             OnSwapped();
  25.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top