//fill buttons for panels void createQuestBtns() { foreach (Quest questAvailable in questAvailables) { GameObject questButton = Instantiate(questBtn); QBtn qBScript = questButton.GetComponent <QBtn>(); qBScript.questID = questAvailable.Qid; qBScript.questTitle.text = questAvailable.Title; questButton.transform.SetParent(qbtnHolder1, false); btns.Add(questButton); } foreach (Quest questOngoing in questActives) { GameObject questButton = Instantiate(questBtn); QBtn qBScript = questButton.GetComponent <QBtn>(); qBScript.questID = questOngoing.Qid; qBScript.questTitle.text = questOngoing.Title; questButton.transform.SetParent(qbtnHolder2, false); btns.Add(questButton); } }
void Start() { acceptBtn = GameObject.Find("QuestCanvas").transform.Find("QuestPanel").transform.Find("Description").transform.Find("GameObject").transform.Find("Accept").gameObject; acceptScript = acceptBtn.GetComponent <QBtn> (); giveupBtn = GameObject.Find("QuestCanvas").transform.Find("QuestPanel").transform.Find("Description").transform.Find("GameObject").transform.Find("Decline").gameObject; declineScript = giveupBtn.GetComponent <QBtn> (); completeBtn = GameObject.Find("QuestCanvas").transform.Find("QuestPanel").transform.Find("Description").transform.Find("GameObject").transform.Find("Complete").gameObject; completeScript = completeBtn.GetComponent <QBtn> (); acceptBtn.SetActive(false); giveupBtn.SetActive(false); completeBtn.SetActive(false); }