Пример #1
0
    void AddMapLabel(ILabel label)
    {
        if (label.GetShow() == EShow.All || label.GetShow() == EShow.MinMap)
        {
            UIMapLabel uiLabel = null;
            if (this.m_MapLabelPool.Count > 0)
            {
                uiLabel = this.m_MapLabelPool.Dequeue();
                uiLabel.gameObject.SetActive(true);
            }
            else
            {
                GameObject obj = GameObject.Instantiate(mMapLabelPrefab) as GameObject;
                obj.transform.parent        = mSubInfoPanel.transform;
                obj.transform.localPosition = Vector3.zero;
                obj.transform.localScale    = Vector3.one;
                obj.transform.localRotation = Quaternion.identity;
                uiLabel = obj.GetComponent <UIMapLabel>();
            }
            if (uiLabel != null)
            {
                uiLabel.transform.localScale = Vector3.one;
                uiLabel.SetLabel(label, true);
                uiLabel.gameObject.name = "MinMapLabel: " + uiLabel._ILabel.GetText();
                this.m_CurrentMapLabelList.Add(uiLabel);
            }

            TryAddMonsterSiegeEffect(uiLabel);

            if (label.GetType() == ELabelType.Mission)
            {
                MissionLabel ml = label as MissionLabel;
                if (ml.m_attachOnID != 0)
                {
                    uiLabel.SetLabelPosByNPC(ml.m_attachOnID);
                }
                //missionID = ml.m_missionID;
                //if ((label as MissionLabel).m_target != null)
                //    targetID = ml.m_target.mID;

                //if (Pathea.PeGameMgr.IsStory)
                //{
                //    if (MissionRepository.m_MissionCommonMap.ContainsKey(missionID))
                //    {
                //        if (ml.m_type == MissionLabelType.misLb_target)
                //        {
                //            if (MissionRepository.m_TypeFollow.ContainsKey(targetID))
                //            {
                //                TypeFollowData fol = MissionManager.GetTypeFollowData(targetID);
                //                if (fol.m_LookNameID != 0)
                //                    uiLabel.SetLabelPosByNPC(fol.m_LookNameID);
                //            }
                //            else if (MissionRepository.m_TypeSearch.ContainsKey(targetID))
                //            {
                //                TypeSearchData ser = MissionManager.GetTypeSearchData(targetID);
                //                if (ser.m_NpcID != 0)
                //                    uiLabel.SetLabelPosByNPC(ser.m_NpcID);
                //            }
                //        }
                //        else if (ml.m_type == MissionLabelType.misLb_unActive)
                //        {
                //            uiLabel.SetLabelPosByNPC(MissionRepository.m_MissionCommonMap[missionID].m_iNpc);
                //        }
                //        else if (ml.m_type == MissionLabelType.misLb_end)
                //        {
                //            uiLabel.SetLabelPosByNPC(MissionRepository.m_MissionCommonMap[missionID].m_iReplyNpc);
                //        }
                //    }
                //    else
                //    {
                //        foreach (var item in NpcMissionDataRepository.dicMissionData)
                //        {
                //            if (item.Value.m_RandomMission != missionID)
                //                continue;
                //            if (ml.m_type == MissionLabelType.misLb_unActive)
                //            {
                //                uiLabel.SetLabelPosByNPC(item.Key);
                //            }
                //            else if (ml.m_type == MissionLabelType.misLb_end)
                //            {
                //                uiLabel.SetLabelPosByNPC(item.Key);
                //            }
                //        }
                //    }
                //}
                //else
                //{
                //    if (AdRMRepository.m_AdRandMisMap.ContainsKey(missionID))
                //    {
                //        if (ml.m_type == MissionLabelType.misLb_target)
                //        {
                //            if (AdRMRepository.m_AdTypeFollow.ContainsKey(targetID))
                //            {
                //                TypeFollowData fol = MissionManager.GetTypeFollowData(targetID);
                //                if (fol.m_LookNameID != 0)
                //                    uiLabel.SetLabelPosByNPC(fol.m_LookNameID);
                //            }
                //            else if (AdRMRepository.m_AdTypeSearch.ContainsKey(targetID))
                //            {
                //                TypeSearchData ser = MissionManager.GetTypeSearchData(targetID);
                //                if (ser.m_NpcID != 0)
                //                    uiLabel.SetLabelPosByNPC(ser.m_NpcID);
                //            }
                //        }
                //        else if (ml.m_type == MissionLabelType.misLb_unActive)
                //        {
                //            uiLabel.SetLabelPosByNPC(AdRMRepository.m_AdRandMisMap[missionID].m_iNpc);
                //        }
                //        else if (ml.m_type == MissionLabelType.misLb_end)
                //        {
                //            uiLabel.SetLabelPosByNPC(AdRMRepository.m_AdRandMisMap[missionID].m_iReplyNpc);
                //        }
                //    }
                //}
            }
        }
    }