HUDController.CreateMapTexture C# (CSharp) 메소드

CreateMapTexture() 개인적인 메소드

private CreateMapTexture ( ) : void
리턴 void
    private void CreateMapTexture()
    {
        this.mapTexture = new Texture2D (this.roomManager.rows * this.roomManager.roomSide,
                                 				 this.roomManager.columns * this.roomManager.roomSide);
        for (var x = 0; x < mapTexture.width; x++) {
            for (var y = 0; y < mapTexture.height; y++) {
                mapTexture.SetPixel(x, y, Color.clear);
            }
        }
        int playerX = (int)(PlayerController.instance.transform.position.x + 15.5f);
        int playerY = (int)(PlayerController.instance.transform.position.y + 15.5f);

        int range = 6;
        for (var x = playerX - range; x < playerX + range; x++) {
            for (var y = playerY - range; y < playerY + range; y++) {
                mapTexture.SetPixel(x, y, this.colorForTile (roomManager.tileMap [x, y]));
            }
        }
        mapTexture.Apply();
    }