//TODO: implement button to swap between gaelic + english translations //TODO: add labels and prettify ui /**A boilerplate function to assign the current clicked settlement details to each and every ui element **/ public void setTextData() { SettlementInformation allInfo = transform.root.GetComponent <SettlementInformation> (); if (allInfo == null) { return; } InfoFieldContainer fields = GameObject.FindGameObjectWithTag("God").GetComponent <InfoFieldContainer> (); fields.headnameOriginal.text = allInfo.headname; fields.slug.text = allInfo.slug; }
public override void Init() { answerGroup = GameObject.FindGameObjectWithTag("AnswerUI").GetComponent <CanvasGroup> (); questionGroup = GameObject.FindGameObjectWithTag("Question").GetComponent <CanvasGroup> (); answersLeftGroup = GameObject.FindGameObjectWithTag("AnswersLeft").GetComponent <CanvasGroup> (); infoContainer = GameObject.FindGameObjectWithTag("God").GetComponent <InfoFieldContainer> (); qc = GameObject.FindGameObjectWithTag("God").GetComponent <QuestionController> (); guessSounds = answerGroup.GetComponents <AudioSource> (); answer = qc.getAnswer().GetComponent <SettlementInformation> (); guess = qc.getCurrentGuess(); moveOn = GameObject.FindGameObjectWithTag("MoveOn").GetComponent <Text> (); guessColour = guess.GetComponentInChildren <ModifyColour> (); answerColour = answer.GetComponentInChildren <ModifyColour> (); options = GameObject.FindGameObjectWithTag("Options"); isGaelic = options != null?options.GetComponent <OptionsManager> ().getIsGaelic() : false; }
void Awake() { thisButton = GetComponent <Button> (); // do this when user clicks on button thisButton.onClick.AddListener(delegate { // get the settlement info InfoFieldContainer allInfo = GetComponent <InfoFieldContainer> (); string url; string settlementPage = "settlement/" + allInfo.slug.text; url = URLHelper.GetCurrentURL(); // open the URL #if !UNITY_EDITOR openWindow(url + settlementPage); #endif }); }