void OnClickChindItem(ButtonScript obj, object args, int param1, int param2) { TaskUI.CurrentId = param1; QuestSystem.aqid = param1; AcceptableCell acell = obj.GetComponent <AcceptableCell>(); if (curCell != null) { curCell.stateSp.gameObject.SetActive(false); curCell.statetwoSp.gameObject.SetActive(false); } curCell = acell; acell.stateSp.gameObject.SetActive(true); acell.statetwoSp.gameObject.SetActive(true); //ShowTaskIonf (param1); TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.ShowTaskIonf(param1); }
void InitQuestKindItem() { foreach (GameObject c in chindCellList) { maingrid.RemoveChild(c.transform); c.transform.parent = null; c.gameObject.SetActive(false); chindCellPoolList.Add(c); } chindCellList.Clear(); maingrid.Reposition(); int index = maingrid.GetIndex(QuestKindsObj[0].transform); List <QuestData> qdas = QuestSystem.GetQuestDataForQuestKind(QuestKinds[0]); List <QuestData> qds = new List <QuestData> (); Profession pro = Profession.get((JobType)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession), GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel)); for (int i = 0; i < qdas.Count; i++) { if (qdas[i].questKind_ == QuestKind.QK_Profession) { if (qdas[i].JobLevel_ != 1) { if (qdas[i].jobtype_ == (int)GamePlayer.Instance.GetIprop(PropertyType.PT_Profession)) { if (qdas[i].JobLevel_ - GamePlayer.Instance.GetIprop(PropertyType.PT_ProfessionLevel) == 1) { qds.Add(qdas[i]); } } } } } for (int i = 0; i < qds.Count; i++) { if (QuestSystem.IsFDailyQuest()) { if (qds[i].questKind_ == QuestKind.QK_Daily) { continue; } } GameObject objCell = null; if (chindCellPoolList.Count > 0) { objCell = chindCellPoolList[0]; chindCellPoolList.Remove(objCell); } else { objCell = Object.Instantiate(item) as GameObject; } UIManager.SetButtonEventHandler(objCell, EnumButtonEvent.OnClick, OnClickChindItem, qds[i].id_, 0); maingrid.AddChild(objCell.transform, ++index); objCell.SetActive(true); objCell.transform.localScale = Vector3.one; AcceptableCell acell = objCell.GetComponent <AcceptableCell>(); acell.Qdata = qds[i]; chindCellList.Add(objCell); maingrid.repositionNow = true; } if (chindCellList.Count > 0) { // AcceptableCell acell = chindCellList[0].GetComponent <AcceptableCell>(); acell.stateSp.gameObject.SetActive(true); acell.statetwoSp.gameObject.SetActive(true); curCell = acell; TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.ShowTaskIonf(qds[0].id_); QuestSystem.aqid = qds[0].id_; } else { TaskUI tui = taskInfoObj.GetComponent <TaskUI> (); tui.closeItem(); tui.chuansongBtn.gameObject.SetActive(false); tui.abnegateBtn.gameObject.SetActive(false); } }