コード例 #1
0
    /// <summary>
    /// 初始化精炼组件
    /// </summary>
    void InitRefineWidgets()
    {
        if (IsInitStatus(ForgingPanelMode.Refine))
        {
            return;
        }
        SetInitStatus(ForgingPanelMode.Refine, true);
        GameObject preObj   = UIManager.GetResGameObj(GridID.Uiitemgrowshowgrid) as GameObject;
        GameObject cloneObj = null;

        if (null == m_refienGrowShow && null != m_trans_RefineInfoRoot && null != preObj)
        {
            cloneObj = NGUITools.AddChild(m_trans_RefineInfoRoot.gameObject, preObj);
            if (null != cloneObj)
            {
                m_refienGrowShow = cloneObj.GetComponent <UIItemGrowShowGrid>();
                if (null == m_refienGrowShow)
                {
                    m_refienGrowShow = cloneObj.AddComponent <UIItemGrowShowGrid>();
                }
            }
        }

        if (null != m_slider_RefineSuccessSlider)
        {
            m_slider_RefineSuccessSlider.onChange.Add(new EventDelegate(OnRefineSuccessValueChanged));
        }
    }
コード例 #2
0
    private void InitPromoteWidgets()
    {
        if (IsInitStatus(TabMode.ShengJi))
        {
            return;
        }
        SetInitStatus(TabMode.ShengJi, true);
        if (null != m_trans_PromoteItemGrowRoot && null == m_promoteGrow)
        {
            Transform ts = UIManager.AddGridTransform(GridID.Uiitemgrowshowgrid, m_trans_PromoteItemGrowRoot);
            if (null != ts)
            {
                m_promoteGrow = ts.GetComponent <UIItemGrowShowGrid>();
                if (null == m_promoteGrow)
                {
                    m_promoteGrow = ts.gameObject.AddComponent <UIItemGrowShowGrid>();
                }
            }
        }
        if (null != m_slider_PromoteExpProgress)
        {
            SlideAnimation slideAnim = m_slider_PromoteExpProgress.GetComponent <SlideAnimation>();
            if (null == slideAnim)
            {
                m_slider_PromoteExpProgress.gameObject.AddComponent <SlideAnimation>();
            }
        }

        CreateMuhonExpGrid();
    }
コード例 #3
0
    private void ReleaseUpgrade(bool depthClear = true)
    {
        if (null != m_promoteGrow)
        {
            m_promoteGrow.Release(depthClear);
            if (depthClear)
            {
                UIManager.OnObjsRelease(m_promoteGrow.CacheTransform, (uint)GridID.Uiitemgrowshowgrid);
                m_promoteGrow = null;
            }
        }

        if (null != m_lst_expGrids)
        {
            if (depthClear)
            {
                for (int i = 0, max = m_lst_expGrids.Count; i < max; i++)
                {
                    m_lst_expGrids[i].Release(depthClear);
                }
                m_lst_expGrids.Clear();
                m_lst_expGrids = null;
            }
        }
    }
コード例 #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>();
    }
コード例 #5
0
    private void InitBlendWidgets()
    {
        if (IsInitStatus(TabMode.RongHe))
        {
            return;
        }
        SetInitStatus(TabMode.RongHe, true);
        Transform clone = null;

        if (null != m_trans_BlendCurShowGrid && null == m_blendCurGrow)
        {
            m_blendCurGrow = m_trans_BlendCurShowGrid.GetComponent <UIItemGrowShowGrid>();
            if (null == m_blendCurGrow)
            {
                m_blendCurGrow = m_trans_BlendCurShowGrid.gameObject.AddComponent <UIItemGrowShowGrid>();
            }
        }

        if (null != m_trans_BlendNextShowGrid && null == m_blendNextGrow)
        {
            m_blendNextGrow = m_trans_BlendNextShowGrid.GetComponent <UIItemGrowShowGrid>();
            if (null == m_blendNextGrow)
            {
                m_blendNextGrow = m_trans_BlendNextShowGrid.gameObject.AddComponent <UIItemGrowShowGrid>();
            }
            m_blendNextGrow.RegisterUIEventDelegate((UIEventType eventType, object data, object param) =>
            {
                if (eventType == UIEventType.Click)
                {
                    OnSelectBlendMuhon();
                }
            });
        }
        m_dic_currentAttrs = new Dictionary <EquipDefine.AttrIndex, UIMuhonPropertyGrid>();
        m_dic_blendAtrs    = new Dictionary <EquipDefine.AttrIndex, UIMuhonPropertyGrid>();
        UIMuhonPropertyGrid eInfoGrid = null;

        if (null != m_grid_CurrentAdditiveAttrContent && null != m_grid_BlendAdditiveAttrContent)
        {
            for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.First;
                 i <= EquipDefine.AttrIndex.Fifth; i++)

            {
                clone = UIManager.AddGridTransform(GridID.Uimuhonpropertygrid, m_grid_CurrentAdditiveAttrContent.transform);
                if (null != clone)
                {
                    clone.name = ((int)i).ToString();
                    eInfoGrid  = clone.GetComponent <UIMuhonPropertyGrid>();
                    if (null == eInfoGrid)
                    {
                        eInfoGrid = clone.gameObject.AddComponent <UIMuhonPropertyGrid>();
                    }
                    if (null != eInfoGrid)
                    {
                        m_dic_currentAttrs.Add(i, eInfoGrid);
                    }
                }

                clone = UIManager.AddGridTransform(GridID.Uimuhonpropertygrid, m_grid_BlendAdditiveAttrContent.transform);
                if (null != clone)
                {
                    clone.name = ((int)i).ToString();
                    eInfoGrid  = clone.GetComponent <UIMuhonPropertyGrid>();
                    if (null == eInfoGrid)
                    {
                        eInfoGrid = clone.gameObject.AddComponent <UIMuhonPropertyGrid>();
                    }
                    if (null != eInfoGrid)
                    {
                        m_dic_blendAtrs.Add(i, eInfoGrid);
                    }
                }
            }
            m_grid_CurrentAdditiveAttrContent.Reposition();
            m_grid_BlendAdditiveAttrContent.Reposition();
        }
    }
コード例 #6
0
    private void InitProccessWidgets()
    {
        if (IsInitStatus(ForgingPanelMode.Proccess))
        {
            return;
        }
        SetInitStatus(ForgingPanelMode.Proccess, true);
        //装备
        GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemgrowshowgrid) as GameObject;

        if (null != preObj)
        {
            GameObject cloneObj = null;
            if (null != m_trans_ProcessInfoRoot && null == m_processGrowShow)
            {
                cloneObj = NGUITools.AddChild(m_trans_ProcessInfoRoot.gameObject, preObj);
                if (null != cloneObj)
                {
                    m_processGrowShow = cloneObj.GetComponent <UIItemGrowShowGrid>();
                    if (null == m_processGrowShow)
                    {
                        m_processGrowShow = cloneObj.AddComponent <UIItemGrowShowGrid>();
                    }
                    m_processGrowShow.RegisterUIEventDelegate(OnUIEventCallback);
                }
            }

            preObj = UIManager.GetResGameObj(GridID.Uiproccessgrid) as GameObject;
            if (null != m_trans_ProcessCostRoot && null == m_processRsGrowShow)
            {
                cloneObj = NGUITools.AddChild(m_trans_ProcessCostRoot.gameObject, preObj);
                if (null != cloneObj)
                {
                    m_processRsGrowShow = cloneObj.GetComponent <UIProccessGrid>();
                    if (null == m_processRsGrowShow)
                    {
                        m_processRsGrowShow = cloneObj.AddComponent <UIProccessGrid>();
                    }
                    m_processRsGrowShow.RegisterUIEventDelegate((eventType, data, param) =>
                    {
                        if (eventType == UIEventType.Click)
                        {
                            if (data is UIItemInfoGrid)
                            {
                                UIItemInfoGrid infoGrid = data as UIItemInfoGrid;
                                if (null != infoGrid && infoGrid.NotEnough && null != param && param is uint)
                                {
                                    ShowItemGet((uint)param);
                                }
                            }
                            else if (data is UIProccessGrid)
                            {
                                if (IsPanelMode(ForgingPanelMode.Proccess))
                                {
                                    if (!IsProccessMode(ForgingProccessMode.Fetch))
                                    {
                                        if (null != param)
                                        {
                                            m_uint_selectRSBaseId = 0;
                                            m_processRsGrowShow.SetGridData(m_uint_selectRSBaseId, needUnload: true);
                                        }
                                        else
                                        {
                                            OnSelectProcessRuneStone();
                                        }
                                    }
                                }
                            }
                        }
                    });
                }
            }
        }


        if (null == m_dic_fpTabs)
        {
            m_dic_fpTabs = new Dictionary <ForgingProccessMode, UITabGrid>();
        }
        m_dic_fpTabs.Clear();
        Transform ts = null;

        if (null != m_trans_ProcessTabs)
        {
            UITabGrid tGrid = null;
            for (ForgingProccessMode i = ForgingProccessMode.Promote; i < ForgingProccessMode.Max; i++)
            {
                ts = m_trans_ProcessTabs.Find(i.ToString() + "Tab");
                if (null == ts)
                {
                    continue;
                }
                tGrid = ts.GetComponent <UITabGrid>();
                if (null == tGrid)
                {
                    tGrid = ts.gameObject.AddComponent <UITabGrid>();
                }
                tGrid.SetGridData(i);
                tGrid.RegisterUIEventDelegate(OnUIEventCallback);
                tGrid.SetHightLight(false);
                m_dic_fpTabs.Add(i, tGrid);
            }
        }
        if (null == m_dic_propCurGrids)
        {
            m_dic_propCurGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>();
        }
        m_dic_propCurGrids.Clear();
        if (null == m_dic_propNextGrids)
        {
            m_dic_propNextGrids = new Dictionary <ForgingProccessPropertyIndex, UIEquipPropertyGrid>();
        }
        m_dic_propNextGrids.Clear();
        if (null == m_dic_propCBs)
        {
            m_dic_propCBs = new Dictionary <ForgingProccessPropertyIndex, UIToggle>();
        }
        m_dic_propCBs.Clear();

        UIEquipPropertyGrid uPGrid = null;
        UIToggle            toggle = null;

        //属性格子
        for (ForgingProccessPropertyIndex i = ForgingProccessPropertyIndex.One
             ; i < ForgingProccessPropertyIndex.Max; i++)
        {
            if (null != m_trans_ProccessPropertyContentRoot)
            {
                //Cur
                ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CPP");
                if (null != ts)
                {
                    uPGrid = ts.GetComponent <UIEquipPropertyGrid>();
                    if (null == uPGrid)
                    {
                        uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>();
                    }
                    m_dic_propCurGrids.Add(i, uPGrid);
                }
                //Nex
                ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "NPP");
                if (null != ts)
                {
                    uPGrid = ts.GetComponent <UIEquipPropertyGrid>();
                    if (null == uPGrid)
                    {
                        uPGrid = ts.gameObject.AddComponent <UIEquipPropertyGrid>();
                    }
                    m_dic_propNextGrids.Add(i, uPGrid);
                }
                //CheckBox
                ts = Util.findTransform(m_trans_ProccessPropertyContentRoot, i.ToString() + "CB");
                if (null != ts)
                {
                    toggle = ts.GetComponent <UIToggle>();
                    if (null == uPGrid)
                    {
                        toggle = ts.gameObject.AddComponent <UIToggle>();
                    }

                    m_dic_propCBs.Add(i, toggle);
                }
            }
        }

        SetProccessMode(ForgingProccessMode.Promote, true);
        //InitPromote();
        //InitRemove();
        //InitFetch();
    }
コード例 #7
0
    /// <summary>
    /// 初始化合成组件
    /// </summary>
    void InitCompoundWidgets()
    {
        if (IsInitStatus(ForgingPanelMode.Compound))
        {
            return;
        }
        SetInitStatus(ForgingPanelMode.Compound, true);
        Transform  tempTs   = null;
        GameObject cloneObj = null;

        //組件
        if (null != m_trans_CompoundGrowShowRoot && null == m_compoundGrowShow)
        {
            tempTs = UIManager.GetObj(GridID.Uiitemgrowshowgrid);
            if (null != tempTs)
            {
                Util.AddChildToTarget(m_trans_CompoundGrowShowRoot, tempTs);
                cloneObj = tempTs.gameObject;
                if (null != cloneObj)
                {
                    m_compoundGrowShow = cloneObj.GetComponent <UIItemGrowShowGrid>();
                    if (null == m_compoundGrowShow)
                    {
                        m_compoundGrowShow = cloneObj.AddComponent <UIItemGrowShowGrid>();
                    }
                    m_compoundGrowShow.RegisterUIEventDelegate(OnUIEventCallback);
                }
            }
        }

        if (null != m_trans_CompoundMainAttrRoot)
        {
            m_compoundAttrTransData = new AttrTransData[5];
            AttrTransData tempAttrData = null;
            StringBuilder strBuilder   = new StringBuilder();
            for (int i = 0, max = m_compoundAttrTransData.Length; i < max; i++)
            {
                tempAttrData = new AttrTransData();
                strBuilder.Remove(0, strBuilder.Length);
                strBuilder.Append(i + 1);
                tempAttrData.Root = m_trans_CompoundMainAttrRoot.Find(strBuilder.ToString());
                if (null == tempAttrData.Root)
                {
                    continue;
                }
                strBuilder.Append("/Content/Grade/Grade");
                tempTs = m_trans_CompoundMainAttrRoot.Find(strBuilder.ToString());
                if (null != tempTs)
                {
                    tempAttrData.Grade = tempTs.GetComponent <UILabel>();
                }
                strBuilder.Remove(0, strBuilder.Length);
                strBuilder.Append(i + 1);
                strBuilder.Append("/Content/Des");
                tempTs = m_trans_CompoundMainAttrRoot.Find(strBuilder.ToString());
                if (null != tempTs)
                {
                    tempAttrData.Des = tempTs.GetComponent <UILabel>();
                }
                m_compoundAttrTransData[i] = tempAttrData;
            }
        }

        //祝福
        if (null != m_trans_ZFRoot && null == m_zfGrowShow)
        {
            tempTs   = m_trans_UIZFGrid;
            cloneObj = tempTs.gameObject;
            if (null != tempTs)
            {
                Util.AddChildToTarget(m_trans_ZFRoot, tempTs);
                if (null != cloneObj)
                {
                    m_zfGrowShow = cloneObj.GetComponent <UIZFGrid>();
                    if (null == m_zfGrowShow)
                    {
                        m_zfGrowShow = cloneObj.AddComponent <UIZFGrid>();
                    }
                }
                m_zfGrowShow.RegisterUIEventDelegate(OnUIEventCallback);
            }
        }


        //副武器初始化
        if (null != m_trans_CompoundDeputyContent)
        {
            m_lst_equipSelects = new List <UIEquipDeputySelectGrid>();

            UIEventDelegate dpdAction = (eventType, obj, param) =>
            {
                if (eventType == UIEventType.Click)
                {
                    UIEquipDeputySelectGrid esg = obj as UIEquipDeputySelectGrid;
                    if (null != param && param is bool)
                    {
                        UnloadCompoundDeputyEquipFill(esg.Index);
                    }
                    else
                    {
                        if (!IsCompoundDeputyEquipFill(esg.Index))
                        {
                            OnSelectCompoundDeputy(esg.Index);
                        }
                    }
                }
            };
            UIEquipDeputySelectGrid dps = null;
            string tempStr = "";
            for (int i = 0; i < 3; i++)
            {
                tempStr = string.Format("EDSG{0}", i + 1);
                tempTs  = m_trans_CompoundDeputyContent.Find(tempStr);
                if (null == tempTs)
                {
                    continue;
                }

                cloneObj = tempTs.gameObject;
                if (null != cloneObj)
                {
                    dps = cloneObj.GetComponent <UIEquipDeputySelectGrid>();
                    if (null == dps)
                    {
                        dps = cloneObj.AddComponent <UIEquipDeputySelectGrid>();
                    }
                    dps.SetIndex(i);
                    dps.RegisterUIEventDelegate(dpdAction);
                    m_lst_equipSelects.Add(dps);
                }
            }
        }

        ResetCompound();
    }