public void Init() { if (m_createInstance) { m_createInstance = false; m_viewTaskInstance = NGUITools.AddChild(TaskViewPoint, Prefab_ViewTask); m_viewTaskInstance.transform.localPosition = Prefab_ViewTask.transform.localPosition; m_viewTask = m_viewTaskInstance.GetComponent <TaskViewBehaviour>(); m_viewTask.GotoFightTaskAct = (taskState) => { Close(); //TaskModel.Instance.ManualTriggerTask(taskState);//修改 LinkConfigItemData item = PathLinkConfigManager.Instance.GetLinkConfigItem(taskState.TaskNewConfigData.Link.ToString()); TaskModel.Instance.JumpView(item); }; m_taskListInstance = NGUITools.AddChild(TaskListPoint, Prefab_TaskList); m_taskListBehaviour = m_taskListInstance.GetComponent <TaskListBehaviour>(); m_taskListBehaviour.ItemSelectedAct = (taskState) => { m_viewTask.Init(taskState); }; } StartCoroutine(m_taskListBehaviour.Init(TaskModel.Instance.TaskDisplayList)); }
public LinkConfigItemData GetLinkConfigItem(string LinkID) { LinkConfigItemData ConfigData = null; if (!linkConfigDataDictionaty.TryGetValue(LinkID, out ConfigData)) { TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "Link列表无法找到LinkID:" + LinkID); } return(ConfigData); }
public void JumpView(LinkConfigItemData itemData) { switch (itemData.LinkType) { case LinkType.Battle: if (EctypeModel.Instance.IsOpenEctype(int.Parse(itemData.LinkPara))) { EctypeModel.Instance.OpenPointToEctypePanel(int.Parse(itemData.LinkPara)); } else { return; } break; case LinkType.NoneLink: return; case LinkType.SystemFun: UI.MainUI.UIType type = (UI.MainUI.UIType)System.Convert.ToInt32(itemData.LinkPara); if (IsOpenSysFun(type)) { //MainUIController.Instance.OpenMainUI(type); JumpTownView(type, itemData.LinkChildren); } else { return; } break; case LinkType.CrusadeBattle: if (EctypeManager.Instance.IsCrusadeEctypeUnlock(int.Parse(itemData.LinkPara))) { UI.MainUI.MainUIController.Instance.OpenMainUI(UI.MainUI.UIType.Crusade, int.Parse(itemData.LinkPara)); } else { return; } break; case LinkType.DefenseBattle: if (DefenceEntryManager.DefenceEctypeEnabled(int.Parse(itemData.LinkPara))) { UI.MainUI.MainUIController.Instance.OpenMainUI(UI.MainUI.UIType.Defence, int.Parse(itemData.LinkPara)); } else { return; } break; } }
private static void OnPostprocessEquipment() { string path = System.IO.Path.Combine(RESOURCE_DATA_FOLDER, "LinkConfig.xml"); TextReader tr = new StreamReader(path); string text = tr.ReadToEnd(); if (text == null) { Debug.LogError("Equipment item file not exist"); return; } else { XmlSpreadSheetReader.ReadSheet(text); XmlSpreadSheet sheet = XmlSpreadSheetReader.Output; string[] keys = XmlSpreadSheetReader.Keys; object[] levelIds = sheet[keys[0]]; List <LinkConfigItemData> tempList = new List <LinkConfigItemData>(); for (int i = 2; i < levelIds.Length; i++) { //if (0 == i) continue; LinkConfigItemData data = new LinkConfigItemData(); data.LinkID = Convert.ToString(sheet["LinkID"][i]); data.LinkType = (LinkType)Convert.ToInt32(sheet["LinkType"][i]); data.LinkPara = Convert.ToString(sheet["LinkPara"][i]); data.LinkChildren = Convert.ToInt32(sheet["LinkChildren"][i]); data.LinkName = Convert.ToString(sheet["LinkName"][i]); data.Des = Convert.ToString(sheet["Des"][i]); string[] LinkIconPaths = Convert.ToString(sheet["LinkIcon"][i]).Split('+'); List <GameObject> prefabList = new List <GameObject>(); foreach (string item in LinkIconPaths) { string pathRes = System.IO.Path.Combine(ASSET_ITEM_DATA_ICON_FOLDER, item + ".prefab"); GameObject go = (GameObject)AssetDatabase.LoadAssetAtPath(pathRes, typeof(GameObject)); prefabList.Add(go); } data.LinkIcon = prefabList; tempList.Add(data); } CreateMedicamentConfigDataList(tempList); } }
public void Show(string linkId) { LinkConfigItemData item = PathLinkConfigManager.Instance.GetLinkConfigItem(linkId); CurrentItem = item; if (item == null) { gameObject.SetActive(false); TraceUtil.Log(SystemModel.Common, "没有找到linkID:" + linkId); return; } gameObject.SetActive(true); Lable_Name.SetText(LanguageTextManager.GetString(item.LinkName)); ShowTips(); }