Bitmask.convertMap C# (CSharp) Method

convertMap() public method

public convertMap ( ) : ].int[
return ].int[
    public int[,] convertMap()
    {
        int [,] atlasIndices = new int[map.GetLength(0),map.GetLength(1)];
        for (y = 0; y < map.GetLength(0); y++ ){
            for (x = 0; x < map.GetLength(1); x++ ){
                atlasIndices[y,x] = translateTile();
            }
        }
        return atlasIndices;
    }

Usage Example

Example #1
0
 void Awake()
 {
     MeshFilter meshFilter = gameObject.AddComponent<MeshFilter>();
     MeshRenderer meshRenderer = gameObject.AddComponent<MeshRenderer>();
     meshRenderer.material = material;
     MeshMaker2D meshMaker = new MeshMaker2D(Map2D.getWidth(), Map2D.getHeight(), alightment == Alignment.Centered);
     Mesh mesh = meshMaker.getMesh();
     Bitmask mapConverter = new Bitmask(Map2D.map);
     mesh.uv = meshMaker.getUVmap((int)atlasSize.x, (int)atlasSize.y, mapConverter.convertMap(), buffer);
     meshFilter.mesh = mesh;
 }
All Usage Examples Of Bitmask::convertMap