Beispiel #1
0
        private void Start()
        {
            textAccept       = GameObject.Find("TextButtonAccept");
            textAcceptScript = textAccept.GetComponent <Text>();

            textDecline       = GameObject.Find("TextButtonDecline");
            textDeclineScript = textDecline.GetComponent <Text>();

            findAcceptButton   = GameObject.Find("Accept").gameObject;
            acceptButtonScript = findAcceptButton.GetComponent <QButtonScript>();
            acceptButton       = findAcceptButton.GetComponent <Button>();

            findDeclineButton   = GameObject.Find("Decline").gameObject;
            declineButtonScript = findDeclineButton.GetComponent <QButtonScript>();
            declineButton       = findDeclineButton.GetComponent <Button>();

            textAcceptScript.color  = Color.clear;
            textDeclineScript.color = Color.clear;

            acceptButton.interactable  = false;
            declineButton.interactable = false;
        }
Beispiel #2
0
        //Fill buttons for quest panel
        void FillQuestButtons()
        {
            foreach (Quest avaliableQuest in avaliableQuests)
            {
                GameObject    questButton = Instantiate(qButton);
                QButtonScript qbsScript   = questButton.GetComponent <QButtonScript>();
                qbsScript.questID         = avaliableQuest.id;
                qbsScript.questTitle.text = avaliableQuest.title;

                questButton.transform.SetParent(qButtonSpacerAvaliable, false);
                qButtons.Add(questButton);
            }

            foreach (Quest runningQuest in runningQuests)
            {
                GameObject    questButton = Instantiate(qButton);
                QButtonScript qbsScript   = questButton.GetComponent <QButtonScript>();
                qbsScript.questID         = runningQuest.id;
                qbsScript.questTitle.text = runningQuest.title;

                questButton.transform.SetParent(qButtonSpacerRunning, false);
                qButtons.Add(questButton);
            }
        }