/* * /// <summary> * /// * /// </summary> * /// <param name="exp"></param> * /// <param name="money">文钱</param> * /// <param name="gold">金币</param> * /// <param name="itemIds"></param> * /// <param name="itemNums"></param> * private void SetNormalReward(uint exp,uint money,uint gold,List<uint> itemIds,List<uint> itemNums) * { * * UIItemShow itemShow = null; * int index = 0; * if (exp > 0) * { * itemShow = index >= m_lstItem.Count ? GetItem() : m_lstItem[index]; * itemShow.gameObject.SetActive(true); * itemShow.ShowWithItemIdNum(MainPlayerHelper.ExpID, exp); * itemShow.transform.localPosition = new UnityEngine.Vector3(index * 90, 0, 0); * index++; * } * if (money > 0)//文钱 * { * itemShow = index >= m_lstItem.Count ? GetItem() : m_lstItem[index]; * itemShow.gameObject.SetActive(true); * itemShow.ShowWithItemIdNum(MainPlayerHelper.MoneyTicketID, money); * itemShow.transform.localPosition = new UnityEngine.Vector3(index * 90, 0, 0); * index++; * } * if (gold > 0)//金币 * { * itemShow = index >= m_lstItem.Count ? GetItem() : m_lstItem[index]; * itemShow.gameObject.SetActive(true); * itemShow.ShowWithItemIdNum(MainPlayerHelper.GoldID, gold); * itemShow.transform.localPosition = new UnityEngine.Vector3(index * 90, 0, 0); * index++; * } * * for (int i = 0; i < itemIds.Count && i < itemNums.Count; ++i) * { * uint itembaseid = itemIds[i]; * uint itemNum = itemNums[i]; * * itemShow = index >= m_lstItem.Count ? GetItem() : m_lstItem[index]; * itemShow.gameObject.SetActive(true); * * itemShow.ShowWithItemIdNum(itembaseid, itemNum); * itemShow.transform.localPosition = new UnityEngine.Vector3(index * 90, 0, 0); * index++; * } * * for (int i = index; i < m_lstItem.Count; i++) * { * m_lstItem[i].gameObject.SetActive(false); * } * m_trans_itemRoot.parent.GetComponent<UIScrollView>().ResetPosition(); * } */ private void SetTargetLabel(QuestTraceInfo taskInfo, ref table.QuestDataBase quest, ref UILabel targetLable) { if (taskInfo != null) { if (taskInfo.taskSubType == TaskSubType.Collection || taskInfo.taskSubType == TaskSubType.KillMonster || taskInfo.taskSubType == TaskSubType.KillMonsterCollect || taskInfo.taskSubType == TaskSubType.DeliverItem) { GameCmd.TaskProcess process = taskInfo.GetTaskProcess(); if (process == TaskProcess.TaskProcess_CanDone) { targetLable.text = string.Format("{0}[00ff00]({1}/{2})", quest.dwStrTarget, taskInfo.operate, taskInfo.state); } else if (process == TaskProcess.TaskProcess_Doing) { targetLable.text = string.Format("{0}[ff0000]({1}/{2})", quest.dwStrTarget, taskInfo.operate, taskInfo.state); } else { targetLable.text = quest.dwStrTarget; } } else { targetLable.text = quest.dwStrTarget; } } else { targetLable.text = quest.dwStrTarget; } }
public Client.INPC GetNPCByTraceInfo(QuestTraceInfo questInfo) { if (null == questInfo) { return(null); } Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem(); if (es == null) { Engine.Utility.Log.Error("实体系统为null"); return(null); } GameCmd.TaskProcess process = questInfo.GetTaskProcess(); uint npcid = 0; uint effectID = 0; if (process == GameCmd.TaskProcess.TaskProcess_None)//可接 { npcid = questInfo.beginNpc; } else if (process == GameCmd.TaskProcess.TaskProcess_CanDone) { npcid = questInfo.endNpc; } else if (process == GameCmd.TaskProcess.TaskProcess_Doing) { npcid = questInfo.endNpc; } Client.INPC npc = es.FindNPCByBaseId((int)npcid); return(npc); }
public void UpdateUI(QuestTraceInfo taskInfo) { //if (m_xmlText == null || m_widght == null || taskInfo == null) if (m_lblText == null || m_widght == null || taskInfo == null) { return; } if (m_taskInfo != null && (m_taskInfo.taskId != taskInfo.taskId || m_taskInfo.dynamicTranceUpdate)) { m_bShow = false; m_taskInfo.dynamicTranceUpdate = false; } m_taskInfo = taskInfo; //如果已经显示 并且状态没发生变化 不刷新UI if (m_bShow && m_nPreState == m_taskInfo.state && m_nPreOpreate == m_taskInfo.operate && m_taskInfo.taskType != TaskType.TaskType_Token) { return; } m_bShow = true; m_nPreState = m_taskInfo.state; m_nPreOpreate = m_taskInfo.operate; string tempstring = taskInfo.strDesc; GameCmd.TaskProcess process = taskInfo.GetTaskProcess(); m_nHeight = 0; if (m_labelTitle != null) { m_labelTitle.text = taskInfo.StrFormatName; m_nHeight = m_labelTitle.height + 8; } if (m_labelState != null) { m_labelState.text = taskInfo.StrState; } //m_xmlText.Clear(); //m_xmlText.fontSize = 20; //m_xmlText.AddXml(RichXmlHelper.RichXmlAdapt(tempstring)); m_lblText.fontSize = 20; m_lblText.text = tempstring; //m_widght.height = m_nHeight + m_xmlText.host.height + 8; m_widght.height = m_nHeight + m_lblText.height + 8; m_nHeight = m_widght.height; if (taskInfo.taskType == TaskType.TaskType_Normal) { if (process == TaskProcess.TaskProcess_None) { SetEffect(false); } else if (process == TaskProcess.TaskProcess_CanDone) { SetEffect(true); } else { SetEffect(false); } } else { SetEffect(false); } int depth = m_widght.depth + 1; //foreach (Transform widget in m_xmlText.transform) //{ // if (widget.GetComponent<BoxCollider>() != null) // { // widget.GetComponent<BoxCollider>().enabled = false; // } // widget.GetComponent<UIWidget>().depth = depth; //} }