示例#1
0
 private void ProcessDrawingWall(TileView tile)
 {
     tile.GetSquare().SetData(SquareData.Empty);
     onUpdateTile?.Invoke(tile);
     tile.GetSquare().SetData(SquareData.Wall);
     onUpdateTile?.Invoke(tile);
 }
示例#2
0
    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;
        }
    }
示例#3
0
 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;
 }
示例#4
0
 public Coord GetPointBCoord() => pointB_tile.GetSquare().GetCoord();
示例#5
0
 private void ProcessErasingTile(TileView tile)
 {
     tile.GetSquare().SetData(SquareData.Empty);
     onUpdateTile?.Invoke(tile);
 }