Пример #1
0
        public void Init(int meridiansID, MeridiansDragPanel myParent)
        {
            //if (meridiansID == 0)//经脉ID为0时特殊处理
            //{
            //    this.MyParent = myParent;
            //    this.m_MeridiansID = meridiansID;
            //    IsUnlock = true;
            //    Background.ChangeSprite(1);
            //    return;
            //}
            int MeridiansLv = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_MERIDIANS_LEVEL + 1;

            CurrentUpLv        = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_HAVEPRACTICE_NUM;
            MyData             = myParent.MyParent.PlayerMeridiansDataManager.GetMeridiansData(meridiansID);
            MyDataLvUpNeed     = myParent.MyParent.PlayerMeridiansDataManager.GetMeridiansData(meridiansID - 1).LevelUpNeed;
            this.m_MeridiansID = meridiansID;
            this.MyParent      = myParent;
            IsUnlock           = m_MeridiansID < MeridiansLv;
            this.Background.ChangeSprite(IsUnlock?1:2);
            SetSliderBar(IsUnlock ?1 :  MeridiansLv == this.m_MeridiansID ? (float)CurrentUpLv / (float)MyDataLvUpNeed : 0);
            if (MeridiansLv == MyData.MeridiansLevel && MyParent.MyParent.CurrentPageID == myParent.PanelPositionID)
            {
                OnClick();
                //TraceUtil.Log("当前经脉ID:" + MeridiansLv + ",当前修炼进度:" + CurrentUpLv + ",当前经脉所需经脉值:" + MyDataLvUpNeed);
            }
            else if (MyParent.MyParent.CurrentPageID == myParent.PanelPositionID && MeridiansLv == MyData.MeridiansLevel && !myParent.CheckIsInMyPanel(MeridiansLv))//检测是否该面板最后一个
            {
                TraceUtil.Log("选中当前面板最后一个经脉");
                OnClick();
            }
        }
Пример #2
0
        /// <summary>
        /// 显示左右翻页提示箭头和修炼按钮显示的特效
        /// </summary>
        void ShowPageArrowAndPracticeButtonActive()
        {
            int currentMeridianID = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_MERIDIANS_LEVEL;
            MeridiansDragPanel meridiansDragPanel = MeridiansDragPanelList.FirstOrDefault(P => P.CheckIsInMyPanel(currentMeridianID) == true);

            if (meridiansDragPanel == null)
            {
                return;
            }
            int MaxPageNum = 0;

            foreach (MeridiansDragPanel child in MeridiansDragPanelList)
            {
                if (child.PanelPositionID > MaxPageNum)
                {
                    MaxPageNum = child.PanelPositionID;
                }
            }
            Color enabelColor  = new Color(1, 1, 1, 1);
            Color disabelColor = new Color(1, 1, 1, 0.3f);

            //PageLeftObj.SetActive(CurrentPageID == 0 ? false : true);
            //PageRightObj.SetActive(CurrentPageID == MaxPageNum ? false : true);
            //PageLeftObj.BackgroundSprite.color = CurrentPageID == 0 ? disabelColor : enabelColor;
            //PageRightObj.BackgroundSprite.color = CurrentPageID == MaxPageNum ? disabelColor : enabelColor;
            practiceButton.SetEffectActive(meridiansDragPanel.PanelPositionID == CurrentPageID);
        }
Пример #3
0
        void ShowKonfuName()
        {
            MeridiansDragPanel meridiansDragPanel = MeridiansDragPanelList.First(P => P.PanelPositionID == CurrentPageID);

            //this.KongfuNameLabel.spriteName = (meridiansDragPanel.playerKongfuData.KongfuNameRes);
            CreatKongfuBackgroundPoint.ClearChild();
            CreatObjectToNGUI.InstantiateObj(meridiansDragPanel.playerKongfuData.KongfuPicPrefab, CreatKongfuBackgroundPoint);
        }
Пример #4
0
 void InitPanel()
 {
     meridiansAttributePanel.Show(this);
     practiceButton.InitMySelf(this);
     Grid.ClearChild();
     MeridiansDragPanelList.Clear();
     //DraggablePanel.ResetPosition();
     this.MeridiansNumLabel.SetButtonText(PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_PRACTICE_NUM.ToString());
     //PlayerKongfuData[] kongfuDataList = PlayerMeridiansDataManager.Instance.PlayerKongfuDataBase.PlayerKongfuDataList;
     foreach (GameObject child in MeridiansDragPanelPrefabList)
     {
         MeridiansDragPanel meridiansDragPanel = CreatObjectToNGUI.InstantiateObj(child, Grid).GetComponent <MeridiansDragPanel>();
         meridiansDragPanel.InitPanel(this);
         MeridiansDragPanelList.Add(meridiansDragPanel);
     }
     ShowKonfuName();
     TurningToUnlockPage();
 }
Пример #5
0
        /// <summary>
        /// 增加经脉修为
        /// </summary>
        /// <param name="Flag">true开始false停止</param>
        public void AddMeridians(bool Flag)
        {
            int currentAddMeridianID = PlayerManager.Instance.FindHeroDataModel().PlayerValues.PLAYER_FIELD_MERIDIANS_LEVEL + 1;
            MeridiansDragPanel meridiansDragPanel = MeridiansDragPanelList.FirstOrDefault(P => P.getMeridiansBtn(currentAddMeridianID) != null);

            if (meridiansDragPanel == null)
            {
                //已修炼完成所有提示
                MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_519"), 1);
                return;
            }
            if (CurrentPageID > meridiansDragPanel.PanelPositionID)
            {
                //需要修炼完xxx内功提示
                if (Flag)
                {
                    var LastMeridiansPanel = MeridiansDragPanelList.FirstOrDefault(P => P.PanelPositionID == CurrentPageID - 1);
                    if (LastMeridiansPanel != null)
                    {
                        string Msg = string.Format(LanguageTextManager.GetString("IDS_H1_375"), LanguageTextManager.GetString(LastMeridiansPanel.playerKongfuData.KongfuName));
                        MessageBox.Instance.ShowTips(3, Msg, 1);
                    }
                }
                return;
            }
            else if (CurrentPageID < meridiansDragPanel.PanelPositionID)
            {
                //已修炼完成提示
                if (Flag)
                {
                    MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_373"), 1);
                }
                return;
            }
            //else if (currentAddMeridianID == MaxMeridiansID && meridiansDragPanel.getMeridiansBtn(currentAddMeridianID).IsUnlock)
            //{
            //    //已修炼完成所有提示
            //    MessageBox.Instance.ShowTips(3, LanguageTextManager.GetString("IDS_H1_519"), 1);
            //}
            else
            {
                MeridiansDragPanelList.ApplyAllItem(P => P.OnAddMeridiansBtnClick(Flag));
            }
        }