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(); }
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(); } }
/// <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(); }