private void ReleaseActiveRemove(bool depthClear = true) { uint resID = 0; if (depthClear && null != mlstMuhonPropertySelects) { resID = (uint)GridID.Uimuhonpropertyselectgrid; for (int i = 0, max = mlstMuhonPropertySelects.Count; i < max; i++) { UIManager.OnObjsRelease(mlstMuhonPropertySelects[i].CacheTransform, resID); } mlstMuhonPropertySelects.Clear(); } if (null != m_activeRemoveGrow) { m_activeRemoveGrow.Release(depthClear); if (depthClear) { resID = (uint)GridID.Uiitemshowgrid; UIManager.OnObjsRelease(m_activeRemoveGrow.CacheTransform, resID); m_activeRemoveGrow = null; } } }
private void InitStrengthenWidgets() { if (IsInitStatus(ForgingPanelMode.Strengthen)) { return; } SetInitStatus(ForgingPanelMode.Strengthen, true); GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemshowgrid); GameObject cloneObj = null; if (null == m_strengthen && null != m_trans_StrengthenInfoRoot && null != preObj) { cloneObj = NGUITools.AddChild(m_trans_StrengthenInfoRoot.gameObject, preObj); if (null != cloneObj) { m_strengthen = cloneObj.GetComponent <UIItemShowGrid>(); if (null == m_strengthen) { m_strengthen = cloneObj.AddComponent <UIItemShowGrid>(); } } } UICurrencyGrid cGrid = null; if (null != m_trans_SingleStrengthenCurrency) { cGrid = m_trans_SingleStrengthenCurrency.GetComponent <UICurrencyGrid>(); if (null == cGrid) { cGrid = m_trans_SingleStrengthenCurrency.gameObject.AddComponent <UICurrencyGrid>(); } } }
protected override void OnLoading() { base.OnLoading(); emgr = DataManager.Manager <EquipManager>(); Transform tempTrans = null; if (null != m_trans_CostRoot && null == m_growCost) { tempTrans = UIManager.GetObj(GridID.Uiitemshowgrid); if (null != tempTrans) { Util.AddChildToTarget(m_trans_CostRoot, tempTrans); m_growCost = tempTrans.GetComponent <UIItemShowGrid>(); if (null == m_growCost) { m_growCost = tempTrans.gameObject.AddComponent <UIItemShowGrid>(); } } } if (null == cardArray && null != m_trans_ResultRoot) { StringBuilder rootBuilder = new StringBuilder(); cardArray = new UICompoundSelectAttrGrid[3]; UICompoundSelectAttrGrid tempGrid = null; Transform parentTs = null; for (int i = 0, max = cardArray.Length; i < max; i++) { rootBuilder.Remove(0, rootBuilder.Length); rootBuilder.Append("ResultRoot"); rootBuilder.Append(i + 1); parentTs = m_trans_ResultRoot.Find(rootBuilder.ToString()); if (null == parentTs) { continue; } tempTrans = UIManager.GetObj(GridID.Uicompoundattrselectgrid); if (null != tempTrans) { Util.AddChildToTarget(parentTs, tempTrans); tempGrid = tempTrans.GetComponent <UICompoundSelectAttrGrid>(); if (null == tempGrid) { tempGrid = tempTrans.gameObject.AddComponent <UICompoundSelectAttrGrid>(); } if (null != tempGrid) { tempGrid.RegisterUIEventDelegate(OnGridEventDlg); } } cardArray[i] = tempGrid; } } }
/// <summary> /// 卸载副武魂 /// </summary> /// <param name="index"></param> private void OnUnloadEvolveMuhon(EquipDefine.AttrIndex index) { if (m_dicSelectMuhonDeputy.ContainsKey(index)) { m_dicSelectMuhonDeputy.Remove(index); UIItemShowGrid showGrid = null; if (m_dicMuhonDeputy.TryGetValue(index, out showGrid)) { showGrid.SetGridData(0, false); } UpdateEvolveSelectStarAnim(); } }
private void InitActivateRemovedWidgets() { if (IsInitStatus(TabMode.JiHuo)) { return; } SetInitStatus(TabMode.JiHuo, true); Transform clone = null; if (null != m_trans_ActiveRemoveItemGrowRoot && null == m_activeRemoveGrow) { clone = UIManager.AddGridTransform(GridID.Uiitemshowgrid, m_trans_ActiveRemoveItemGrowRoot); if (null != clone) { m_activeRemoveGrow = clone.GetComponent <UIItemShowGrid>(); if (null == m_activeRemoveGrow) { m_activeRemoveGrow = clone.gameObject.AddComponent <UIItemShowGrid>(); } } } mlstMuhonPropertySelects = new List <UIMuhonPropertySelectGrid>(); if (null != m_grid_ActivePropertyRoot) { UIMuhonPropertySelectGrid grid = null; for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.First ; i <= EquipDefine.AttrIndex.Fifth; i++) { clone = UIManager.AddGridTransform(GridID.Uimuhonpropertyselectgrid, m_grid_ActivePropertyRoot.transform); if (null != clone) { clone.name = ((int)i).ToString(); grid = clone.GetComponent <UIMuhonPropertySelectGrid>(); if (null == grid) { grid = clone.gameObject.AddComponent <UIMuhonPropertySelectGrid>(); } grid.RegisterCheckBoxDlg(UpdateActiveRemovePropertySelect); mlstMuhonPropertySelects.Add(grid); } } m_grid_ActivePropertyRoot.Reposition(); } }
private void ReleaseEvolve(bool depthClear = true) { uint resID = 0; if (null != m_evolveCurGrow) { resID = (uint)GridID.Uiitemshowgrid; m_evolveCurGrow.Release(depthClear); if (depthClear) { UIManager.OnObjsRelease(m_evolveCurGrow.CacheTransform, resID); } } if (null != m_evolveMaxGrow) { resID = (uint)GridID.Uiitemgrowshowgrid; m_evolveMaxGrow.Release(depthClear); if (depthClear) { UIManager.OnObjsRelease(m_evolveMaxGrow.CacheTransform, resID); } } if (depthClear && null != m_dicMuhonDeputy) { UIItemShowGrid tempGrid = null; resID = (uint)GridID.Uiitemshowgrid; for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.None + 1; i < EquipDefine.AttrIndex.Max; i++) { if (m_dicMuhonDeputy.TryGetValue(i, out tempGrid)) { tempGrid.Release(true); UIManager.OnObjsRelease(tempGrid.CacheTransform, resID); } } m_dicMuhonDeputy.Clear(); } ResetEvolveAnim(); }
protected override void OnLoading() { base.OnLoading(); if (null == m_infoGrid && null != m_trans_InfoGridRoot) { GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemshowgrid) as GameObject; if (null != preObj) { GameObject cloneObj = NGUITools.AddChild(m_trans_InfoGridRoot.gameObject, preObj); if (null != cloneObj) { m_infoGrid = cloneObj.GetComponent <UIItemShowGrid>(); if (null == m_infoGrid) { m_infoGrid = cloneObj.AddComponent <UIItemShowGrid>(); } if (null != m_infoGrid && !m_infoGrid.Visible) { m_infoGrid.SetVisible(true); } } } } }
protected override void OnLoading() { base.OnLoading(); GameObject preObj = UIManager.GetResGameObj(GridID.Uiitemshowgrid); GameObject cloneObj = null; UIEventDelegate dlg = (eventType, data, param) => { if (eventType == UIEventType.Click) { TipsManager.Instance.ShowItemTips(evolveMuhonId); } }; if (null != preObj) { if (null == mShowGrid && null != m_trans_InfoGridRoot) { cloneObj = NGUITools.AddChild(m_trans_InfoGridRoot.gameObject, preObj); if (null != cloneObj) { mShowGrid = cloneObj.GetComponent <UIItemShowGrid>(); if (null == mShowGrid) { mShowGrid = cloneObj.AddComponent <UIItemShowGrid>(); } if (null != mShowGrid && !mShowGrid.Visible) { mShowGrid.SetVisible(true); mShowGrid.RegisterUIEventDelegate(dlg); } } } } Transform tempTrans = null; if (null != m_trans_BaseAttr) { m_lstBaseAttr = new List <Transform>(); for (int i = 1; i <= 4; i++) { tempTrans = m_trans_BaseAttr.Find(i.ToString()); if (null != tempTrans) { m_lstBaseAttr.Add(tempTrans); } } } if (null != m_trans_AdditiveAttr) { m_lstAddtiveAttr = new List <Transform>(); for (int i = 1; i <= 5; i++) { tempTrans = m_trans_AdditiveAttr.Find(i.ToString()); if (null != tempTrans) { m_lstAddtiveAttr.Add(tempTrans); } } } if (null != m_widget_GapWidget) { gapWidget = m_widget_GapWidget.gameObject.transform.localPosition; } }
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); } } } }
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>(); }
protected override void OnLoading() { base.OnLoading(); GameObject preObj = null; if (null == m_showGrid && null != m_trans_InfoGridRoot) { preObj = UIManager.GetResGameObj(GridID.Uiitemshowgrid); if (null != preObj) { GameObject cloneObj = NGUITools.AddChild(m_trans_InfoGridRoot.gameObject, preObj); if (null != cloneObj) { m_showGrid = cloneObj.GetComponent <UIItemShowGrid>(); if (null == m_showGrid) { m_showGrid = cloneObj.AddComponent <UIItemShowGrid>(); } if (null != m_showGrid && !m_showGrid.Visible) { m_showGrid.SetVisible(true); m_showGrid.RegisterUIEventDelegate((eventType, data, param) => { if (eventType == UIEventType.Click) { Muhon muhon = DataManager.Manager <ItemManager>().GetBaseItemByQwThisId <Muhon>(blendMuhonId); if (null != muhon) { TipsManager.Instance.ShowItemTips(muhon); } } }); } } } } mlstGrids = new List <UIProperyGradeGrid>(); preObj = UIManager.GetResGameObj(GridID.Uiproperygradegrid) as GameObject; if (null != m_grid_AdditiveContent) { UIProperyGradeGrid mGrid = null; GameObject obj = null; for (EquipDefine.AttrIndex i = EquipDefine.AttrIndex.First ; i <= EquipDefine.AttrIndex.Fifth; i++) { obj = NGUITools.AddChild(m_grid_AdditiveContent.gameObject, preObj); if (null != obj) { obj.name = ((int)i).ToString(); mGrid = obj.GetComponent <UIProperyGradeGrid>(); if (null == mGrid) { mGrid = obj.gameObject.AddComponent <UIProperyGradeGrid>(); } mlstGrids.Add(mGrid); } } m_grid_AdditiveContent.Reposition(); } }