/// <summary> /// Initializes the Edge cell. /// </summary> /// <param name="cell">The cell itself</param> /// <param name="neighbour">The neighbour of the cell</param> /// <param name="direction">The direction from the cell to its neighbour</param> public void InitializeEdge(LabyrinthCell cell, LabyrinthCell neighbour, LabyrinthDirection direction) { this.Cell = cell; this.NeighbourCell = neighbour; this.Direction = direction; // Set the edge of the cell. cell.SetCellEdge(direction, this); // Set the cell as parent transform.parent = cell.transform; transform.localPosition = Vector3.zero; transform.localRotation = direction.GetRotation(); }