// 创建MissionItem
    bool AddMissionItem(int nMissionID, GameObject resItem)
    {
        if (nMissionID < 0)
        {
            return(false);
        }

        Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0);

        if (MissionDic == null)
        {
            LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID);
            return(false);
        }

        if (m_CommpletedItemCount < 0)
        {
            return(false);
        }

        for (int i = 0; i < m_MissionItemsList.Count; ++i)
        {
            if (null != m_MissionItemsList[i])
            {
                if (m_MissionItemsList[i] && m_MissionItemsList[i].MissionID == nMissionID)
                {
                    return(false);
                }
            }
        }

        GameObject ItemObj = Utils.BindObjToParent(resItem, m_MissionsList.gameObject, "MissionItem-1");

        if (ItemObj)
        {
            MissionItemLogic MissionItem = ItemObj.GetComponent <MissionItemLogic>();
            if (MissionItem == null)
            {
                return(false);
            }

            byte   yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID);
            string strMissionColor = GetColorByQuality(yMissionQuality);

            MissionItem.MissionID        = nMissionID;
            MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, strMissionColor, "[489667]");
            MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", "0");
            MissionItem.UpdateMissionEffect();

//             if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID)
//             {
//               MissionItem.SetAwardItemID(GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID());
//             }
//             else
//               MissionItem.SetAwardItemID(-1);

            //if (GameManager.gameManager.MissionManager.GetMissionType(nMissionID) == (int)MISSIONTYPE.MISSION_PAOHUAN)
            //{
            //    MissionItem.SetAwardItemID(GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID());
            //}
            //else
            //  MissionItem.SetAwardItemID(-1);

            // 主线任务放在接任务最上面
            int nTempIndex = m_CommpletedItemCount;
            if (nTempIndex >= 0 && nTempIndex < m_MissionItemsList.Count &&
                (int)MISSIONTYPE.MISSION_MAIN == GameManager.gameManager.MissionManager.GetMissionType(m_MissionItemsList[nTempIndex].MissionID))
            {
                nTempIndex++;
            }
            if (nTempIndex > m_MissionItemsList.Count)
            {
                nTempIndex = m_MissionItemsList.Count;
            }
            m_MissionItemsList.Insert(nTempIndex, MissionItem);
        }

        m_AcceptMissionButton.SetActive(false);

        return(true);
    }
    // 策划要求:任务追踪 跨场景不变  添加 任务Item并设置状态
    void InitMissionItemList(List <int> nMissionSortList, GameObject resItem)
    {
        for (int i = 0; i < nMissionSortList.Count; ++i)
        {
            int nMissionID = nMissionSortList[i];
            if (nMissionID < 0)
            {
                return;
            }

            Tab_MissionDictionary MissionDic = TableManager.GetMissionDictionaryByID(nMissionID, 0);
            if (MissionDic == null)
            {
                LogModule.ErrorLog("Can not find missionDictionary {0}", nMissionID);
                return;
            }

            GameObject ItemObj = Utils.BindObjToParent(resItem, m_MissionsList.gameObject, "MissionItem" + i);
            if (ItemObj)
            {
                MissionItemLogic MissionItem = ItemObj.GetComponent <MissionItemLogic>();
                if (MissionItem == null)
                {
                    return;
                }

                byte   yMissionQuality = GameManager.gameManager.MissionManager.GetMissionQuality(nMissionID);
                string strMissionColor = GetColorByQuality(yMissionQuality);

                MissionItem.MissionID        = nMissionID;
                MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, strMissionColor, "[489667]");
                MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", "0");
                MissionItem.OnUpdateMissionStateIcon(MissionState.Mission_None);
                MissionItem.UpdateMissionEffect();

                m_MissionItemsList.Add(MissionItem);
                SetPaoHuanAwardItemID();


                // 设置状态
                MissionState misState = (MissionState)GameManager.gameManager.MissionManager.GetMissionState(nMissionID);
                if (MissionState.Mission_Completed == misState)
                {
                    MissionItem.MissionTile.text = string.Format(MissionDic.MissionName, "[AFF9CD]", "[AFF9CD]");

                    int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0);
                    MissionItem.MissionInfo.text = "[AFF9CD]" + string.Format(MissionDic.FollowText, "[AFF9CD]", nParam);
                    MissionItem.OnUpdateMissionStateIcon(misState);

//                  if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID)
//                      MissionItem.SetAwardItemID (GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID ());
//                  else
//                      MissionItem.SetAwardItemID (-1);
                    UpdateMissionFollowBlink(i, true);

                    m_CommpletedItemCount += 1;

                    // 添加新手指引
                    if (nMissionID == 2 || nMissionID == 7)
                    {
                        m_GuideMissionFlag = true;
                        ShowNewPlayerGuide(nMissionID);
                    }
                }
                else
                {
                    string StrMissionTile = MissionDic.MissionName;
                    if (MissionState.Mission_Failed == misState)
                    {
                        StrMissionTile = "[489667]" + StrDictionary.GetClientDictionaryString("#{1362}") + StrMissionTile;
                    }
                    MissionItem.MissionTile.text = string.Format(StrMissionTile, strMissionColor, "[489667]");
//                  if (nMissionID == GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentMissionID)
//                      MissionItem.SetAwardItemID (GameManager.gameManager.MissionManager.PaoHuanInfo.CurrentSpecialAwardItemID ());
//                  else
//                      MissionItem.SetAwardItemID (-1);
                    int nParam = GameManager.gameManager.MissionManager.GetMissionParam(nMissionID, 0);
                    if (nParam != 0)
                    {
                        MissionItem.MissionInfo.text = "[489667]" + string.Format(MissionDic.FollowText, "[489667]", nParam);
                        MissionItem.OnUpdateMissionStateIcon(misState);
                    }
                }
            }
        }

        SortMissionItem();

        if (m_MissionsList)
        {
#if UNITY_WP8
            DoRepositionForce();
#else
            m_MissionsList.repositionNow = true;
#if BOBJOYSTICK
            RefreshJoyGUI();
#endif
#endif
        }
    }