Beispiel #1
0
    protected bool CanOccupyTile_Overworld(Index2 tile)
    {
        if (!WorldInfo.Instance.IsOverworld)
        {
            return(true);
        }

        int  tileCode  = CommonObjects.OverworldTileMap.TryGetTile(tile);
        bool canOccupy = TileMapData.IsTileCodeValid(tileCode) && TileInfo.IsTilePassable(tileCode);

        Vector3 from = transform.position;
        Vector3 to   = tile.ToVector3();

        to.y = from.y;
        DrawDebugLine(from, to, canOccupy);

        return(canOccupy);
    }