void onVisibleBtnClicked(GameObject btnGo, MapLayers.MapLayer layer) { bool curVisible = layer.IsVisible; bool newVisible = !curVisible; changeVisibleTexture(btnGo.GetComponent <Image>(), newVisible); mapLayers.VisibleLayer(layer.LayerName, newVisible); }