private void ProcessDrawingWall(TileView tile) { tile.GetSquare().SetData(SquareData.Empty); onUpdateTile?.Invoke(tile); tile.GetSquare().SetData(SquareData.Wall); onUpdateTile?.Invoke(tile); }
private void OnUpdateTile(TileView tile) { if (tile == null) { return; } switch (tile.GetSquare().GetData()) { case SquareData.Empty: tile.GetIcon()?.gameObject.SetActive(false); tile.SetIcon(null); break; case SquareData.PointA: pointA.gameObject.SetActive(true); pointA.localPosition = tile.GetPixelPosition(); tile.SetIcon(pointA); break; case SquareData.PointB: pointB.gameObject.SetActive(true); pointB.localPosition = tile.GetPixelPosition(); tile.SetIcon(pointB); break; case SquareData.Wall: RectTransform wall = wallTilePool.GetInstance().GetComponent <RectTransform>(); wall.localPosition = tile.GetPixelPosition(); wall.gameObject.SetActive(true); tile.SetIcon(wall); break; } }
private void ProcessDrawingPoint(TileView tilePoint, TileView newTile, SquareData data) { if (tilePoint != null) { tilePoint.GetSquare().SetData(SquareData.Empty); } newTile.GetSquare().SetData(data); onUpdateTile?.Invoke(tilePoint); onUpdateTile?.Invoke(newTile); current_drawstate = DrawState.None; }
public Coord GetPointBCoord() => pointB_tile.GetSquare().GetCoord();
private void ProcessErasingTile(TileView tile) { tile.GetSquare().SetData(SquareData.Empty); onUpdateTile?.Invoke(tile); }