示例#1
0
 private void UpdateEvolveSelectStarAnim()
 {
     if (null != Data)
     {
         MuhonStarData starData = null;
         //选择完成动画
         EquipDefine.AttrIndex nextAttrIndex = (EquipDefine.AttrIndex)(Data.StartLevel + 1);
         for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.None + 1; i < EquipDefine.AttrIndex.Max; i++)
         {
             if (m_dicStarData.TryGetValue(i, out starData))
             {
                 if (i < nextAttrIndex)
                 {
                     starData.SetStatus(true);
                 }
                 else
                 {
                     starData.SetStatus(false);
                 }
                 if (i == nextAttrIndex)
                 {
                     starData.PlayStarAnim(IsSelectMuhonDeputySuccess());
                 }
                 else
                 {
                     starData.PlayStarAnim(false);
                 }
             }
         }
     }
 }
示例#2
0
 private Transform GetStarTransByStarLv(uint startLv)
 {
     if (startLv == 0)
     {
         return(null);
     }
     if (startLv >= (uint)EquipDefine.AttrIndex.First && startLv < (uint)EquipDefine.AttrIndex.Max)
     {
         EquipDefine.AttrIndex index    = (EquipDefine.AttrIndex)startLv;
         MuhonStarData         starData = null;
         if (m_dicStarData.TryGetValue(index, out starData))
         {
             return(starData.Ts);
         }
     }
     return(null);
 }
示例#3
0
    private void UpdateEvolve(Muhon data)
    {
        if (null == data)
        {
            return;
        }
        bool isMaxStarLv = data.IsMaxStarLv;

        if (null != m_trans_EvolveInfos &&
            m_trans_EvolveInfos.gameObject.activeSelf == isMaxStarLv)
        {
            m_trans_EvolveInfos.gameObject.SetActive(!isMaxStarLv);
        }
        if (!isMaxStarLv)
        {
            if (null != m_evolveCurGrow)
            {
                m_evolveCurGrow.SetGridData(data.QWThisID);
            }
            MuhonStarData starData = null;

            UIItemShowGrid showGrid = null;
            //星级显示
            for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.None + 1; i < EquipDefine.AttrIndex.Max; i++)
            {
                if (m_dicStarData.TryGetValue(i, out starData))
                {
                    starData.SetStatus(data.StartLevel >= (int)i);
                }

                if (m_dicMuhonDeputy.TryGetValue(i, out showGrid) && null != showGrid)
                {
                    if ((int)i > data.EvolveNeedMuhonNum)
                    {
                        showGrid.SetVisible(false);
                    }
                    else
                    {
                        if (!showGrid.Visible)
                        {
                            showGrid.SetVisible(true);
                        }

                        if (IsDeputyEvolveGridFill(i))
                        {
                            showGrid.SetGridData(m_dicSelectMuhonDeputy[i], true);
                        }
                        else
                        {
                            showGrid.SetGridData(0);
                        }
                    }
                }
            }
            //辅助物品


            UpdateEvolveSelectStarAnim();
            Muhon next = data.Next;
            //预览
            //星级
            if (null != m_slider_EvolveCurStarLv)
            {
                m_slider_EvolveCurStarLv.value = data.StartLevel / 5f;
            }
            if (null != m_slider_EvolveNextStarLv)
            {
                m_slider_EvolveNextStarLv.value = next.StartLevel / 5f;
            }
            //等级
            if (null != m_label_EvolveCurLv)
            {
                m_label_EvolveCurLv.text = tmgr.GetLocalFormatText(LocalTextType.Local_Txt_Set_4, data.MaxLv);
            }
            if (null != m_label_EvolveNextLv)
            {
                m_label_EvolveNextLv.text = tmgr.GetLocalFormatText(LocalTextType.Local_Txt_Set_4, next.MaxLv);
            }
            int attrCount = data.AdditionAttrCount;
            //附加属性
            if (null != m_label_EvolveCurAttrNum)
            {
                m_label_EvolveCurAttrNum.text = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, data.MuhonAttrUpLimit);
            }
            if (null != m_label_EvolveNextAttrNum)
            {
                m_label_EvolveNextAttrNum.text = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, data.Next.MuhonAttrUpLimit);
            }
            ColorType color = ColorType.JZRY_Green;
            if (null != m_label_EvolveMuhonLv)
            {
                if (data.Level != data.MaxLv)
                {
                    color = ColorType.JZRY_Txt_NotMatchRed;
                }
                else
                {
                    color = ColorType.JZRY_Green;
                }

                m_label_EvolveMuhonLv.text = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_Soul_ColorLv,
                                                                     ColorManager.GetNGUIColorOfType(ColorType.JZRY_Txt_Black)
                                                                     , ColorManager.GetNGUIColorOfType(color), data.Level, data.MaxLv);
            }

            //角色等级限制
            if (null != m_label_EvolvePlayerLvLmit)
            {
                if (DataManager.Instance.PlayerLv < data.EvolveNeedPlayerLv)
                {
                    color = ColorType.JZRY_Txt_NotMatchRed;
                }
                else
                {
                    color = ColorType.JZRY_Green;
                }
                m_label_EvolvePlayerLvLmit.text = string.Format("{0}圣魂升星需达{1}主角{2}级"
                                                                , tmgr.GetMuhonStarName(data.StartLevel)
                                                                , ColorManager.GetNGUIColorOfType(color)
                                                                , data.EvolveNeedPlayerLv);
            }

            //辅助道具
            SetEvolveAssit();
        }

        //最大星级
        if (null != m_trans_EvolveMax &&
            m_trans_EvolveMax.gameObject.activeSelf != isMaxStarLv)
        {
            m_trans_EvolveMax.gameObject.SetActive(isMaxStarLv);
        }
        if (isMaxStarLv)
        {
            //刷新圣魂升级信息
            if (null != m_evolveMaxGrow)
            {
                m_evolveMaxGrow.SetGridData(data.QWThisID);
            }
            List <EquipDefine.EquipBasePropertyData> baseProperyList = emgr.GetWeaponSoulBasePropertyData(data.BaseId, data.Level);
            int countCur = (null != baseProperyList) ? baseProperyList.Count : 0;
            if (countCur == 0)
            {
                Engine.Utility.Log.Error("进化表格数据错误");
                return;
            }
            if (null != m_sprite_EvolveAttrTitle)
            {
                m_sprite_EvolveAttrTitle.transform.Find("Value").GetComponent <UILabel>().text
                    = tmgr.GetLocalFormatText(LocalTextType.Local_TXT_Soul_Num, data.MuhonAttrUpLimit);
            }
            EquipDefine.EquipBasePropertyData temp = null;
            if (null != m_sprite_EvolveAttr1)
            {
                if (countCur >= 1)
                {
                    temp = baseProperyList[0];
                    m_sprite_EvolveAttr1.transform.Find("Name").GetComponent <UILabel>().text  = temp.Name;
                    m_sprite_EvolveAttr1.transform.Find("Value").GetComponent <UILabel>().text = temp.ToString();
                }
                else if (m_sprite_EvolveAttr1.gameObject.activeSelf)
                {
                    m_sprite_EvolveAttr1.gameObject.SetActive(false);
                }
            }
            if (null != m_sprite_EvolveAttr2)
            {
                if (countCur >= 2)
                {
                    temp = baseProperyList[1];
                    m_sprite_EvolveAttr2.transform.Find("Name").GetComponent <UILabel>().text  = temp.Name;
                    m_sprite_EvolveAttr2.transform.Find("Value").GetComponent <UILabel>().text = temp.ToString();
                }
                else if (m_sprite_EvolveAttr2.gameObject.activeSelf)
                {
                    m_sprite_EvolveAttr2.gameObject.SetActive(false);
                }
            }
            if (null != m_sprite_EvolveAttr3)
            {
                if (countCur >= 3)
                {
                    temp = baseProperyList[2];
                    m_sprite_EvolveAttr3.transform.Find("Name").GetComponent <UILabel>().text  = temp.Name;
                    m_sprite_EvolveAttr3.transform.Find("Value").GetComponent <UILabel>().text = temp.ToString();
                }
                else if (m_sprite_EvolveAttr3.gameObject.activeSelf)
                {
                    m_sprite_EvolveAttr3.gameObject.SetActive(false);
                }
            }
            if (null != m_sprite_EvolveAttr4)
            {
                if (countCur >= 4)
                {
                    temp = baseProperyList[3];
                    m_sprite_EvolveAttr4.transform.Find("Name").GetComponent <UILabel>().text  = temp.Name;
                    m_sprite_EvolveAttr4.transform.Find("Value").GetComponent <UILabel>().text = temp.ToString();
                }
                else if (m_sprite_EvolveAttr4.gameObject.activeSelf)
                {
                    m_sprite_EvolveAttr4.gameObject.SetActive(false);
                }
            }
        }
    }
示例#4
0
    private void InitEvolveWidgets()
    {
        if (IsInitStatus(TabMode.JinHua))
        {
            return;
        }
        SetInitStatus(TabMode.JinHua, true);

        if (null != m_widget_PreviewCollider)
        {
            UIEventListener.Get(m_widget_PreviewCollider.gameObject).onClick = (preViewObj) =>
            {
                SetEvolvePre(false);
            };
        }

        Transform clone = null;

        if (null != m_trans_EvolveGrowRoot && null == m_evolveCurGrow)
        {
            clone = UIManager.AddGridTransform(GridID.Uiitemshowgrid, m_trans_EvolveGrowRoot);
            if (null != clone)
            {
                m_evolveCurGrow = clone.GetComponent <UIItemShowGrid>();
                if (null == m_evolveCurGrow)
                {
                    m_evolveCurGrow = clone.gameObject.AddComponent <UIItemShowGrid>();
                }
            }
        }

        m_dicStarData    = new Dictionary <EquipDefine.AttrIndex, MuhonStarData>();
        m_dicMuhonDeputy = new Dictionary <EquipDefine.AttrIndex, UIItemShowGrid>();

        Transform      tempTrans    = null;
        UIToggle       tempToggle   = null;
        string         indexStr     = "";
        UIItemShowGrid tempShowGrid = null;

        UIEventDelegate deputyAction = (eventType, data, param) =>
        {
            if (eventType == UIEventType.Click && data is UIItemShowGrid)
            {
                UIItemShowGrid        showGrid = data as UIItemShowGrid;
                EquipDefine.AttrIndex index    = EquipDefine.AttrIndex.None;
                if (TryGetEvolveGridAttrIndex(showGrid.CacheTransform.gameObject, out index))
                {
                    if (null != param && param is bool)
                    {
                        OnUnloadEvolveMuhon(index);
                    }
                    else if (!IsDeputyEvolveGridFill(index))
                    {
                        OnSelectEvolveMuhon(index);
                    }
                }
            }
        };

        m_dicParticleWidgets = new Dictionary <EquipDefine.AttrIndex, UIParticleWidget>();
        UIParticleWidget tempParticleWidget = null;
        Transform        tempParticleTran   = null;

        //星星爆点组件初始化
        if (null == m_evolveStarBoomParticleWidget && null != m_trans_EvolveStarLightParticle)
        {
            m_evolveStarBoomParticleWidget = m_trans_EvolveStarLightParticle.GetComponent <UIParticleWidget>();
            if (null == m_evolveStarBoomParticleWidget)
            {
                m_evolveStarBoomParticleWidget = m_trans_EvolveStarLightParticle.gameObject.AddComponent <UIParticleWidget>();
            }
            if (null != m_evolveStarBoomParticleWidget && null != m_label_EvolveEffetDepthLimitMask)
            {
                m_evolveStarBoomParticleWidget.depth = m_label_EvolveEffetDepthLimitMask.depth - 1;
            }
        }

        //进化目标组件爆点初始化
        if (null == m_evolveTargetParticleWidget && null != m_trans_EvolveTargeParticle)
        {
            m_evolveTargetParticleWidget = m_trans_EvolveTargeParticle.GetComponent <UIParticleWidget>();
            if (null == m_evolveTargetParticleWidget)
            {
                m_evolveTargetParticleWidget = m_trans_EvolveTargeParticle.gameObject.AddComponent <UIParticleWidget>();
            }
            if (null != m_evolveTargetParticleWidget && null != m_label_EvolveEffetDepthLimitMask)
            {
                m_evolveTargetParticleWidget.depth = m_label_EvolveEffetDepthLimitMask.depth - 1;
            }
        }

        for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.None + 1; i < EquipDefine.AttrIndex.Max; i++)
        {
            if (!Enum.IsDefined(typeof(EquipDefine.AttrIndex), i)) //|| i == EquipDefine.AttrIndex.Fifth)
            {
                continue;
            }
            indexStr = ((int)i).ToString();
            if (null != m_trans_CostEvolveStar)
            {
                tempTrans = m_trans_CostEvolveStar.Find(indexStr);
                if (null != tempTrans)
                {
                    tempToggle = tempTrans.GetComponent <UIToggle>();
                    if (null != tempToggle)
                    {
                        m_dicStarData.Add(i, MuhonStarData.Create(tempToggle, i));
                    }
                }
            }

            if (null != m_trans_CostEvolveMuhon)
            {
                if (null != tempTrans)
                {
                    tempTrans        = m_trans_CostEvolveMuhon.Find(indexStr);
                    tempParticleTran = tempTrans.Find(indexStr);
                    if (null != tempParticleTran)
                    {
                        tempParticleWidget = tempParticleTran.GetComponent <UIParticleWidget>();
                        if (null == tempParticleWidget)
                        {
                            tempParticleWidget = tempParticleTran.gameObject.AddComponent <UIParticleWidget>();
                        }
                        if (null != tempParticleWidget)
                        {
                            if (null != m_label_EvolveEffetDepthLimitMask)
                            {
                                tempParticleWidget.depth = m_label_EvolveEffetDepthLimitMask.depth - 1;
                            }
                            if (!m_dicParticleWidgets.ContainsKey(i))
                            {
                                m_dicParticleWidgets.Add(i, tempParticleWidget);
                            }
                        }
                    }


                    clone        = UIManager.AddGridTransform(GridID.Uiitemshowgrid, tempTrans);
                    tempShowGrid = clone.GetComponent <UIItemShowGrid>();
                    if (null == tempShowGrid)
                    {
                        tempShowGrid = clone.gameObject.AddComponent <UIItemShowGrid>();
                    }
                    if (null != tempShowGrid)
                    {
                        tempShowGrid.RegisterUIEventDelegate(deputyAction);
                        m_dicMuhonDeputy.Add(i, tempShowGrid);
                    }
                }
            }
        }

        if (null != m_trans_EvolveMaxGrowRoot && null == m_evolveMaxGrow)
        {
            clone = UIManager.AddGridTransform(GridID.Uiitemgrowshowgrid, m_trans_EvolveMaxGrowRoot);
            if (null != clone)
            {
                m_evolveMaxGrow = clone.GetComponent <UIItemGrowShowGrid>();
                if (null == m_evolveMaxGrow)
                {
                    m_evolveMaxGrow = clone.gameObject.AddComponent <UIItemGrowShowGrid>();
                }
            }
        }

        m_dicSelectMuhonDeputy = new Dictionary <EquipDefine.AttrIndex, uint>();
    }