public void SetData(Cell cell) { Type = cell.Type; CurrentDirection = cell.CurrentDirection; PreviousDirection = cell.PreviousDirection; Coorditanes[0] = cell.Coorditanes[0]; Coorditanes[1] = cell.Coorditanes[1]; }
public void Move(Cell cell) { I = cell.Coorditanes[0]; J = cell.Coorditanes[1]; _start = transform.position; _destinition = new Vector3(cell.Coorditanes[0], cell.Coorditanes[1], 20f); IsMoving = true; }
private void SwapCells(Cell cell1, Cell cell2) { Cell cell = new Cell(0,0); cell.SetData(cell1); cell1.SetData(cell2); cell2.SetData(cell); }
private CellType GetNextCellType(CellType type, Cell nextCell) { var cellInfo = new CellInfo(type, nextCell.CurrentDirection, nextCell.PreviousDirection); var result = CellType.Empty; if (cellTypes.TryGetValue(cellInfo, out result)) { return result; } return GetTurnType(nextCell.CurrentDirection, nextCell.PreviousDirection); }
private void FieldOnCreateBodyPart(Cell cell) { CreateSnakeBodyPartSignal.Dispatch(cell, View.transform); }