public void Init(int nQuestIndex) { m_questIndex = nQuestIndex; CQuestManager questMgr = CQuestManager.Inst; Data.QuestInfo?info = CDataManager.Inst.QuestContainer.GetQuest(m_questIndex); if (info == null) { Debug.LogError("Info is Missing"); return; } m_questInfo = info.Value; if (m_questnameText != null) { m_questnameText.text = info.Value.questName; } if (m_questTargetIcon != null) { CUnitData unitData = CDataManager.Inst.UnitContainer.GetUnitData(m_questInfo.mainTargetType, m_questInfo.mainTargetIdx); if (unitData != null) { m_questTargetIcon.sprite = unitData.IconImage; } } }
public void QuestSet(Data.QuestInfo questInfo) { if (m_selectQuest == null) { m_selectQuest = questInfo; } m_questName = questInfo.questName; m_questTarget = CDataManager.Inst.UnitContainer.GetUnitData(questInfo.mainTargetType, questInfo.mainTargetIdx); }
public void Init() { //TextAsset textAsset = Resources.Load<TextAsset>("Data/QuestInfos"); string questText = File.ReadAllText(Application.streamingAssetsPath + "/Data/QuestInfos.xml"); //if (textAsset == null) // return; XmlDocument document = new XmlDocument(); document.LoadXml(questText); //document.LoadXml(textAsset.text); XmlNode root = document.SelectSingleNode("QuestInfos"); XmlNodeList quests = root.SelectNodes("Quest"); for (int i = 0; i < quests.Count; i++) { QuestInfo info = new QuestInfo(); XmlNode name = quests[i].SelectSingleNode("Name"); info.questName = name.InnerText; XmlNode areaName = quests[i].SelectSingleNode("AreaName"); info.areaName = areaName.InnerText; XmlNode targetType = quests[i].SelectSingleNode("Type"); info.mainTargetType = (UnitType)int.Parse(targetType.InnerText); XmlNode targetIdx = quests[i].SelectSingleNode("TargetIndex"); info.mainTargetIdx = int.Parse(targetIdx.InnerText); XmlNode targetCount = quests[i].SelectSingleNode("TargetCount"); info.mainTargetCount = int.Parse(targetCount.InnerText); XmlNode timeLimit = quests[i].SelectSingleNode("TimeLimit"); info.timeLimit = float.Parse(timeLimit.InnerText); m_questInfos.Add(info); } }
public void QuestSet(Data.QuestInfo questInfo) { m_selectedQuest = questInfo; }