public void Init() { this.detailView.gameObject.SetActive(false); // 이전에 있던 Element 반환 for (int i = 0; i < this.elements.Length; i++) { ObjectPoolManager.inst.Return(this.elements[i].gameObject); } // 현재 진행중인 퀘스트정보를 받아 리스트로 보여줌 this.elements = new QuestUI_QuestElement[QuestManager.inst.progessingQuest.Count]; for (int i = 0; i < QuestManager.inst.progessingQuest.Count; i++) { this.elements[i] = ObjectPoolManager.inst.Get <QuestUI_QuestElement>(PrefabPath.UI.QuestUI_QuestElement); this.elements[i].transform.SetParent(this.scrollRect.content, false); (this.elements[i].transform as RectTransform).anchoredPosition3D = Vector3.zero; this.elements[i].transform.localRotation = Quaternion.identity; this.elements[i].transform.localScale = Vector3.one; this.elements[i].Init( this, QuestManager.inst.progessingQuest[i].key, QuestDatabase.GetInfo(QuestManager.inst.progessingQuest[i].key).title); } }
public void Init(string key) { this.questInfo = QuestDatabase.GetInfo(key); // 제목 텍스트 갱신 this.titleText.text = this.questInfo.title; // 컨텐츠 텍스트 갱신 string content = this.questInfo.content + "\n\n"; for (int i = 0; i < this.questInfo.ifText.Length; i++) { int progress = QuestManager.inst.GetProgress(this.questInfo.questKey, this.questInfo.requestKey[i]); content += string.Format("{0} <color={1}>[{2} / {3}]</color>\n", this.questInfo.ifText[i], this.questInfo.request[i] <= progress ? Defines.TRUE_COLOR_CODE : Defines.FALSE_COLOR_CODE, Mathf.Min(progress, this.questInfo.request[i]), this.questInfo.request[i]); } this.contentText.text = content; // 보상 UI 처리 for (int i = 0; i < this.elements.Length; i++) { ObjectPoolManager.inst.Return(this.elements[i].gameObject); // 기존 Element제거 } this.elements = new QuestDetailView_RewardElement[this.questInfo.rewardKey.Length]; for (int i = 0; i < this.questInfo.rewardKey.Length; i++) { this.elements[i] = ObjectPoolManager.inst.Get <QuestDetailView_RewardElement>(PrefabPath.UI.QuestDetailView_RewardElement); this.elements[i].transform.SetParent(this.rewardLayout, false); (this.elements[i].transform as RectTransform).anchoredPosition3D = Vector3.zero; this.elements[i].transform.localRotation = Quaternion.identity; this.elements[i].transform.localScale = Vector3.one; this.elements[i].Init(this.questInfo.rewardKey[i], this.questInfo.reward[i]); } // 퀵뷰버튼 처리 UpdateQuickViewText(); }