Ejemplo n.º 1
0
 public void InitPanel(int index, EctypeSelectConfigData ectypeSelectConfigData, EctypePanel_V4 myParent)
 {
     this.PositionIndex = index;
     this.myParent      = myParent;
     if (transform.childCount > 0)
     {
         transform.ClearChild();
     }
     this.ectypeSelectConfigData = ectypeSelectConfigData;
     this.ectypeSelectConfigData.InitectContainer();
     for (int i = 0; i < this.ectypeSelectConfigData._vectContainer.Length; i++)
     {
         //add by lee 如果是封妖副本 break
         if (ectypeSelectConfigData._vectContainer[i] == ectypeSelectConfigData._sirenEctypeContainerID)
         {
             break;
         }
         GameObject EctypeCard = null;
         EctypeCard = CreatObjectToNGUI.InstantiateObj(LocalEctypeCarPrefab, transform);
         LocalEctypePanel_v3 ectypeCard = EctypeCard.GetComponent <LocalEctypePanel_v3>();
         ectypeCard.ContainerID = ectypeSelectConfigData._lEctypeID;
         ectypeCard.InitPanel(this.ectypeSelectConfigData._vectContainer[i], myParent);
         this.LocalPanelList.Add(ectypeCard);
     }
     SetMyPosition(index);
 }
Ejemplo n.º 2
0
 public void InitPanel(int EctypeID, EctypePanel_V4 myParent)
 {
     this.myParent       = myParent;
     ectypeContainerData = EctypeConfigManager.Instance.EctypeContainerConfigList[EctypeID];
     CreatEctypeIconTransform.ClearChild();
     this.EctypeIcon = CreatObjectToNGUI.InstantiateObj(myParent.EctypeContainerIconData.iconDataList.First(P => P.lEctypeContainerID == ectypeContainerData.lEctypeContainerID &&
                                                                                                            P.lDifficulty == ectypeContainerData.lDifficulty).EctypeIconPrefab, CreatEctypeIconTransform).GetComponent <UISprite>();
     this.EctypeIcon.color = Color.gray;
     this.SuggestionLabel.SetText("");
     this.NameTitle.SetButtonText(ectypeContainerData.MapType == 1 ?"":LanguageTextManager.GetString(ectypeContainerData.lEctypeName));
     GradLabel.gameObject.SetActive(false);
     this.lockLvLabel.SetButtonText(string.Format("{0}{1}{2}", ectypeContainerData.lMinActorLevel, LanguageTextManager.GetString("IDS_H1_156"), LanguageTextManager.GetString("IDS_H2_56")));
     this.NameTitle.SetTextColor(ectypeContainerData.MapType == 0 || ectypeContainerData.MapType == 7 ? Color.white : Color.red);
     this.Background_NorMal.gameObject.SetActive(ectypeContainerData.MapType == 0 || ectypeContainerData.MapType == 7 ? true : false);
     //TraceUtil.Log("ectypeContainerData.MapType:" + ectypeContainerData.MapType);
     this.Background_Hard.gameObject.SetActive(ectypeContainerData.MapType == 1? true : false);
     this.Background_Siren.gameObject.SetActive(false);
     InitGuide(this.gameObject);
     //TraceUtil.Log("初始话副本:" + LanguageTextManager.GetString(ectypeContainerData.lEctypeName) + "," + EctypeID);
     SetPosition();
 }
Ejemplo n.º 3
0
//        public void UnlockMyself(SMSGEctypeData_SC sMSGEctypeData_SC)
//        {
//            //if (ectypeContainerData.lMinActorLevel > PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL)
//            //    return;
//            //UnlockObj = gameObject;
//            this.sMSGEctypeData_SC = sMSGEctypeData_SC;
//            this.IsLock = false;
//            if (this.EctypeIcon != null)
//            {
//                this.EctypeIcon.color = Color.white;
//            }
//            else
//            {
//                TraceUtil.Log(SystemModel.Common,TraceLevel.Error,"未初始副本收到解锁消息:" + sMSGEctypeData_SC.dwEctypeID + "," + sMSGEctypeData_SC.byDiff + "," + LanguageTextManager.GetString(this.ectypeContainerData.lEctypeName));
//                //TraceUtil.Log(SystemModel.Common,TraceLevel.Error,"emptyEctypeIcon");
//            }
//            this.SuggestionLabel.SetText(string.Format(LanguageTextManager.GetString("IDS_H1_501"),NGUIColor.SetTxtColor(this.ectypeContainerData.PlayerNum.ToString(),TextColor.red)));
//            this.lockLvLabel.gameObject.SetActive(false);
//            //TraceUtil.Log("已经解锁副本评级:" + sMSGEctypeData_SC.byGrade);
//            if (sMSGEctypeData_SC.byGrade != 0)
//            {
//                GradLabel.gameObject.SetActive(true);
//                GradLabel.SetButtonBackground(sMSGEctypeData_SC.byGrade);
//            }
//            this.DayTimesLabel.gameObject.SetActive(sMSGEctypeData_SC.byMaxDayTimes > 0 ? true : false);
//            this.DayTimesLabel.SetButtonText(string.Format(LanguageTextManager.GetString("IDS_H1_315"), sMSGEctypeData_SC.byCurDayTimes, sMSGEctypeData_SC.byMaxDayTimes));
//            bool DropInfoIsNull = ectypeContainerData.DropInf.Equals("0") ;
//            this.GetItemLabel.gameObject.SetActive(!DropInfoIsNull);
//            if (!DropInfoIsNull)
//            {
//                //bool FirstFlag = sMSGEctypeData_SC.byFirstFlag == 1 ? true : false;
//                //TraceUtil.Log("封魔副本是否首杀:" + sMSGEctypeData_SC.byFirstFlag);
//                //TraceUtil.Log("封魔副本日使用次数:" + sMSGEctypeData_SC.byCurDayTimes + "," + sMSGEctypeData_SC.byMaxDayTimes);
//                this.GetItemLabel.SetButtonText(LanguageTextManager.GetString(ectypeContainerData.DropInf.Split('+')[sMSGEctypeData_SC.byFirstFlag]));
//            }
//            if (this.sMSGEctypeData_SC.dwEctypeID == 120&&this.sMSGEctypeData_SC.byDiff == 1)
//            {
//                this.OnClick();
//            }
//        }
//
//        public void UnSelectMyself(SMSGEctypeData_SC data)
//        {
//            if (sMSGEctypeData_SC.byDiff!=data.byDiff||sMSGEctypeData_SC.dwEctypeID!=data.dwEctypeID)
//            {
//                Background_NorMal.ChangeSprite(1);
//                Background_Hard.ChangeSprite(1);
//                Background_Siren.ChangeSprite(1);
//            }
//        }
        /// <summary>
        /// 创建妖女副本
        /// </summary>
        /// <param name="regionID">区域id</param>
        /// <param name="ectypeID">副本id</param>
        /// <param name="myParent">父体</param>
        /// <param name="time">时间(毫秒)</param>
        public void CreateSirenPanel(int regionID, int ectypeID, EctypePanel_V4 myParent, int time)
        {
            IsSirenEctype       = true;
            this.myParent       = myParent;
            ectypeContainerData = EctypeConfigManager.Instance.EctypeContainerConfigList[ectypeID];
            //this.EctypeIcon.spriteName = ectypeContainerData.lEctypeIcon;
            if (EctypeIcon != null)
            {
                this.EctypeIcon.gameObject.SetActive(false);
                this.EctypeIcon.color = Color.gray;
            }
            //this.SirenEctypeIcon.gameObject.SetActive(true);
            CreatSirenIconTransform.ClearChild();
            this.SirenEctypeIcon = CreatObjectToNGUI.InstantiateObj(myParent.EctypeContainerIconData.iconDataList.First(
                                                                        P => P.lEctypeContainerID == ectypeContainerData.lEctypeContainerID && P.lDifficulty == ectypeContainerData.lDifficulty
                                                                        ).EctypeIconPrefab, CreatSirenIconTransform).GetComponent <UISprite>();
            //this.SirenEctypeIcon.spriteName = ectypeContainerData.lEctypeIcon;
            this.SuggestionLabel.SetText("");
            //this.NameTitle.SetButtonText(LanguageTextManager.GetString(ectypeContainerData.lEctypeName));
            this.lockLvLabel.SetButtonText(string.Format("{0}{1}{2}", ectypeContainerData.lMinActorLevel, LanguageTextManager.GetString("IDS_H1_156"), LanguageTextManager.GetString("IDS_H2_56")));
            //this.NameTitle.SetButtonBackground(ectypeContainerData.MapType == 0?1:2);
            //this.NameTitle.SetTextColor(ectypeContainerData.MapType == 0 ? Color.white : Color.red);
            this.NameTitle.gameObject.SetActive(false);
            this.GradLabel.gameObject.SetActive(false);
            this.Background_NorMal.gameObject.SetActive(false);
            //TraceUtil.Log("CreatSirenPanel");
            this.Background_Hard.gameObject.SetActive(false);
            this.Background_Siren.gameObject.SetActive(true);

            SetPosition();
            transform.localPosition += new Vector3(0, 0, -50);//盖住前一个ectypeCard

//            this.sMSGEctypeData_SC = new SMSGEctypeData_SC()
//            {
//                dwEctypeID = (uint)regionID,
//                byDiff = (byte)ectypeContainerData.lDifficulty,
//            };
            this.IsLock = false;
            if (EctypeIcon != null)
            {
                this.EctypeIcon.color = Color.white;
            }
            this.lockLvLabel.gameObject.SetActive(false);

            //时间
            m_SirenTime      = time / 1000f;
            m_lastMinuteTime = (int)(m_SirenTime / 60);
            m_IsCountDown    = true;
            Label_SirenTime.gameObject.SetActive(true);
            Label_SirenTime.text = ParseTime(m_lastMinuteTime);

            //特效
            GameObject eff_broke = (GameObject)Instantiate(Eff_Refining_Broken);

            eff_broke.transform.parent        = Eff_emission;
            eff_broke.transform.localPosition = Vector3.zero;
            eff_broke.transform.localScale    = Eff_Refining_Broken.transform.localScale;
            var containEctype = EctypeConfigManager.Instance.EctypeSelectConfigList.Values.SingleOrDefault(p => p._sirenEctypeContainerID == ectypeID);
            var ectypeData    = EctypeConfigManager.Instance.EctypeContainerConfigList[containEctype._vectContainer.First()];
            EctypeAppearBrokenChangeTexture cTex = eff_broke.GetComponent <EctypeAppearBrokenChangeTexture>();

            cTex.ChangeTexture(ectypeData.lEctypeIcon);
            GameObject eff_loop = (GameObject)Instantiate(Eff_Refining_AppearLoop);

            eff_loop.transform.parent        = Eff_emission;
            eff_loop.transform.localPosition = Vector3.zero;
            eff_loop.transform.localScale    = Eff_Refining_AppearLoop.transform.localScale;

            InitGuide(this.gameObject);
        }