public MapData GetMapData() { Voteable v = voteables[mapState.currentMapID]; Debug.Log("current map voteable ID: " + mapState.currentMapID); MapButton button = v.GetComponent <MapButton> (); Debug.Log("Button being referenced: " + button); MapData data = button.GetMap(); Debug.Log("MapData of referenced button: " + data); return(voteables[mapState.currentMapID].GetComponent <MapButton> ().GetMap()); }