예제 #1
0
    private static FeTileInfo CreateTileInfo(ETileType type, int avoid = 0, int phyDef = 0, int fireDef = 0, int iceDef = 0, int thunderDef = 0)
    {
        FeTileInfo r = new FeTileInfo(type);

        r.avoid      = avoid;
        r.phyDef     = phyDef;
        r.fireDef    = fireDef;
        r.iceDef     = iceDef;
        r.thunderDef = thunderDef;
        return(r);
    }
예제 #2
0
    public ETileType GetTileType(Vector3Int position)
    {
        if (mapRoot == null)
        {
            return(ETileType.Unreachable);
        }
        var t = tileLayer.GetTile(position) as SuperTiled2Unity.SuperTile;

        if (t == null)
        {
            return(ETileType.Unreachable);
        }
        var tileType = FeTileInfo.FromString(t.m_Type);

        return(tileType);
    }
예제 #3
0
    public void InitTileTypeData()
    {
        var superMapInfo = mapRoot.GetComponent <SuperTiled2Unity.SuperMap>();

        mapSize     = new Vector2Int(superMapInfo.m_Width, superMapInfo.m_Height);
        mapTileType = new ETileType[mapSize.x, mapSize.y];

        for (int i = 0; i < mapSize.x; i++)
        {
            for (int j = 0; j < mapSize.y; j++)
            {
                var t = tileLayer.GetTile(PositionMath.TilePositionToGridPosition(new Vector2Int(i, j))) as SuperTiled2Unity.SuperTile;
                mapTileType[i, j] = FeTileInfo.FromString(t.m_Type);
            }
        }
        PositionMath.SetTileTypeData(mapTileType);
    }