Beispiel #1
0
    public void AddItems(List <QuestData> qudes)
    {
        for (int i = 0; i < qudes.Count; i++)
        {
            //QuestData qdata = QuestData.GetData(qlist[i].questId_);
            GameObject o = GameObject.Instantiate(item) as GameObject;
            o.SetActive(true);
            o.name             = o.name + i;
            o.transform.parent = grid.transform;
            TaskuiCell tcell = o.GetComponent <TaskuiCell>();
            tcell.Qdata = qudes[i];
            o.transform.localPosition = new Vector3(0, 0, 0);
            o.transform.localScale    = new Vector3(1, 1, 1);
            UIManager.SetButtonEventHandler(o, EnumButtonEvent.OnClick, OnClickbtn, qudes[i].id_, 0);

            grid.repositionNow = true;
            QuestsList_.Add(o);
        }

        if (QuestSystem.CurrentList.Count > 0 && qudes.Count > 0)
        {
            ShowTaskIonf(CurrentId = qudes[0].id_);
            etTrackingState(qudes[0].id_);
        }
    }
Beispiel #2
0
    private void IsMainQuest(int qid)
    {
        for (int i = 0; i < QuestsList_.Count; i++)
        {
            if (QuestsList_[i] == null)
            {
                continue;
            }

            TaskuiCell tcell = QuestsList_[i].GetComponent <TaskuiCell>();
            if (tcell.Qdata.id_ == qid && tcell.Qdata.questKind_ == QuestKind.QK_Main)
            {
                abnegateBtn.gameObject.SetActive(false);
            }
            else if (tcell.Qdata.id_ == qid && tcell.Qdata.questKind_ != QuestKind.QK_Main)
            {
                abnegateBtn.gameObject.SetActive(true);
            }
        }
    }