public BoardCell BehindTheBackOfOccupying(BoardCell cell) { if (!cell.IsOccupied) { return(null); } var index = Board.Cells.IndexOf(cell) + (cell.OccupiedBy.GetComponent <ActorComponent>().Model.IsFacingLeft ? 1 : -1); if (!Board.Cells.IndexInBounds(index)) { return(null); } var behindTheBack = Board.Cells[index]; if (!behindTheBack.IsWalkable) { return(null); } return(behindTheBack); }
private void OnCellMouseUp(BoardCell cell) { CellMouseUp?.Invoke(cell); }
private void OnCellMouseDown(BoardCell cell) { AudioManager.Instance.PlayOneShot(this.cellClickSound); CellMouseDown?.Invoke(cell); }
private void OnCellMouseExit(BoardCell cell) { CellMouseExit?.Invoke(cell); }
private void OnCellMouseEnter(BoardCell cell) { LastHoveredCell = cell; CellMouseEnter?.Invoke(cell); }
public void Initialize(BoardCell cell) { Cell = cell; }