示例#1
0
    public void TileUpdated(WorldEventArg we)
    {
        // If not on the tile detail panel, ignore this
        if (!mainUiManager.currentUi.Equals("TileDetail"))
        {
            return;
        }

        // Get i and j from e
        Vector3Int loc  = we.location;
        int        iLoc = loc.x;
        int        jLoc = loc.y;

        // If looking at this tile, update this tile
        if (iLoc == tileDetailUI.iLoc && jLoc == tileDetailUI.jLoc)
        {
            tileDetailUI.FocusOnTile(iLoc, jLoc);
        }
    }
示例#2
0
    public void ProcessMapChange(WorldEventArg we)
    {
        // Get i and j from e
        Vector3Int loc = we.location;
        int        i   = loc.x;
        int        j   = loc.y;

        // Delete the old tiles
        groundTileMap.SetTile(loc, null);
        surfaceTileMap.SetTile(loc, null);
        undergroundTileMap.SetTile(loc, null);

        // Draw the ground & surface tiles
        groundTileMap.SetTile(loc, groundTiles[domain.mapData.GetGroundValue(i, j)]);
        if (domain.mapData.GetSurfaceValue(i, j) >= 0)
        {
            surfaceTileMap.SetTile(loc, surfaceTiles[domain.mapData.GetSurfaceValue(i, j)]);
        }

        // Draw the underground tiles
        undergroundTileMap.SetTile(loc, undergroundTiles[domain.mapData.GetUndergroundValue(i, j)][domain.mapData.GetStoneValue(i, j)]);
    }
 public static void Broadcast(worldEventChannels channel, Enum ev, WorldEventArg e)
 {
     ListenerFunctions[channel][ev](e);
 }