public GameObject GetUnlockTipsMessageInstance() { if (this.UnlockTipsMessagePanelInstance == null) { this.UnlockTipsMessagePanelInstance = CreatObjectToNGUI.InstantiateObj(UnlockTipsObject, MessageInstanceParent); } return(this.UnlockTipsMessagePanelInstance); }
public GameObject GetOneButtonMessageInstance() { if (this.MsgObjWtOneBtnInstance == null) { this.MsgObjWtOneBtnInstance = CreatObjectToNGUI.InstantiateObj(MessageObject_OneButton, MessageInstanceParent); } return(this.MsgObjWtOneBtnInstance); }
public GameObject GetTwoButtonMoneyMessageInstance() { if (this.MsgObjWtTwoBtnMoneyInstance == null) { this.MsgObjWtTwoBtnMoneyInstance = CreatObjectToNGUI.InstantiateObj(MessageObject_TwoBtnMoney, MessageInstanceParent); } return(this.MsgObjWtTwoBtnMoneyInstance); }
public void Show() { ClearLoadingPanel(); if (LoadingPanelPrefab != null) { InstanceObj = CreatObjectToNGUI.InstantiateObj(LoadingPanelPrefab, transform); LoadingUIPanel UIPanelScripts = InstanceObj.GetComponent <LoadingUIPanel>(); } }
void Awake() { PlayerTitleConfigData[] titleConfig = PlayerDataManager.Instance.GetPlayerTitleConfigArray(); List <PlayerTitleItem> ownTitleList = new List <PlayerTitleItem>(); List <PlayerTitleItem> dontHadTitleList = new List <PlayerTitleItem>(); titleConfig.ApplyAllItem(p => { GameObject titleGO = (GameObject)CreatObjectToNGUI.InstantiateObj(PlayerTitleItemPrefab, Grid.transform); PlayerTitleItem playerTitleItem = titleGO.GetComponent <PlayerTitleItem>(); bool isUnlock = ContainerInfomanager.Instance.GetItemNumber(p._lGoodsID) > 0; playerTitleItem.Init(p._lGoodsID, isUnlock, p._lDisplayIdSmallPrefab, SelectTitle); m_TitleItemDict.Add(p._lGoodsID, playerTitleItem); //加成属性 List <string> effectStr = new List <string>(); string[] vectEffectStr = p._vectEffects.Split('|'); string[] addEffectStr = p._vectEffectsAdd.Split('|'); effectStr.AddRange(vectEffectStr); effectStr.AddRange(addEffectStr); int effectLength = effectStr.Count; List <PlayerTitleEffectData> effectDataList = new List <PlayerTitleEffectData>(); for (int i = 0; i < effectLength; i++) { string[] growthEffect = effectStr[i].Split('+'); var effectData = ItemDataManager.Instance.GetEffectData(growthEffect[0]); if (effectData != null) { PlayerTitleEffectData titleGrowEffextdata = new PlayerTitleEffectData() { EffectData = effectData, MinValue = Convert.ToInt32(growthEffect[1]), MaxValue = Convert.ToInt32(growthEffect[2]) }; effectDataList.Add(titleGrowEffextdata); } } m_TitleEffectDict.Add(p._lGoodsID, effectDataList); }); Grid.Reposition(); //SelectTitle(titleConfig[0]._lGoodsID); Button_Return.SetCallBackFuntion(OnReturnClick, null); Button_Use.SetCallBackFuntion(OnUseClick, null); m_startPos_LeftPanel = LeftPanel.transform.localPosition; m_startPos_RightPanel = RightPanel.transform.localPosition; m_PanelList.AddRange(gameObject.GetComponentsInChildren <UIPanel>()); RegisterEventHandler(); StartCoroutine("LateRecordPos"); TaskGuideBtnRegister(); }
void ShowNoEnoughVigourPanel(object obj) { if (BuyVigourMessagePanel == null) { BuyVigourMessagePanel = CreatObjectToNGUI.InstantiateObj(BuyVigourMessagePrefab, transform).GetComponent <VigourMessagePanel>(); } string ShowStr = string.Format(LanguageTextManager.GetString("IDS_H1_158"), 40); BuyVigourMessagePanel.Show(string.Format("{0}\n{1}", LanguageTextManager.GetString("IDS_H1_161"), ShowStr)); }
public void Show() { CommonPanelTitle.TweenShow(); transform.localPosition = Vector3.zero; ShowIn(); UpdateTitleInfo(); //已获得特效 bool isHasPlay = false; m_TitleItemDict.ApplyAllItem(p => { bool isUnlock = ContainerInfomanager.Instance.GetItemNumber(p.Key) > 0; if (isUnlock) { isHasPlay = true; var itemData = ContainerInfomanager.Instance.itemFielArrayInfo.SingleOrDefault(k => k.LocalItemData._goodID == p.Key); if (itemData.equipmentEntity.ITEM_FIELD_VISIBLE_NEW == 0) { GameObject ownEff = (GameObject)CreatObjectToNGUI.InstantiateObj(Effect_Title_GetText01_Prefab, p.Value.transform); ownEff.transform.localPosition += Vector3.back * 10 + Vector3.down * 4; ownEff.AddComponent <DestroySelf>(); GameObject ownEff2 = (GameObject)CreatObjectToNGUI.InstantiateObj(Effect_Title_GetText02_Prefab, p.Value.transform); ownEff2.transform.localPosition += Vector3.back * 10 + Vector3.down * 4; ownEff2.AddComponent <DestroySelf>(); NetServiceManager.Instance.ContainerService.SendUpdateContainerGoodsNewStatu((int)itemData.sSyncContainerGoods_SC.SMsgContainerCSCHead.dwContainerID, (byte)itemData.sSyncContainerGoods_SC.nPlace); } else { GameObject ownEff = (GameObject)CreatObjectToNGUI.InstantiateObj(Effect_Title_GetUI_Prefab, p.Value.transform); ownEff.transform.localPosition += Vector3.back * 10 + Vector3.down * 4; ownEff.AddComponent <DestroySelf>(); } } }); if (isHasPlay) { SoundManager.Instance.PlaySoundEffect("Sound_UIEff_Title_Get"); } //选择第一个 m_TitleItemDict.ApplyAllItem(p => { if (p.Value.transform.localPosition == m_TitleTransList[0]) { SelectTitle(p.Key); } }); }
public void Show(MedicamentData m_MedicamentData, bool ShowPathLink) { ISShowing = true; this.m_curGoodID = m_MedicamentData._goodID; if (ShowPathLink) { Btn_PathLink.gameObject.SetActive(true); Button_Use.gameObject.SetActive(false); Button_Sell.gameObject.SetActive(false); // Button_Exit.gameObject.SetActive(false); Button_AllUse.gameObject.SetActive(false); } else { Btn_PathLink.gameObject.SetActive(false); Button_Use.gameObject.SetActive(true); Button_Sell.gameObject.SetActive(m_MedicamentData._TradeFlag == 1); // Button_Exit.gameObject.SetActive(true); Button_AllUse.gameObject.SetActive(true); } TextColor textColor = TextColor.white; switch (m_MedicamentData._ColorLevel) { case 0: textColor = TextColor.EquipmentGreen; break; case 1: textColor = TextColor.EquipmentBlue; break; case 2: textColor = TextColor.EquipmentMagenta; break; case 3: textColor = TextColor.EquipmentYellow; break; } Label_GoodName.text = NGUIColor.SetTxtColor(LanguageTextManager.GetString(m_MedicamentData._szGoodsName), textColor); Switch_Icon.ChangeSprite(m_MedicamentData._ColorLevel + 1); CreatObjectToNGUI.InstantiateObj(m_MedicamentData._DisplayIdSmall, Point_GiftIcon); Label_AllowLevel.text = m_MedicamentData._AllowLevel.ToString(); int playerLevel = PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL; if (playerLevel >= m_MedicamentData._AllowLevel) { m_isArrowLevel = true; Label_AllowLevel.color = Color.white; } else { m_isArrowLevel = false; Label_AllowLevel.color = Color.red; } this.m_curNum = ContainerInfomanager.Instance.GetItemNumber(m_curGoodID); Label_Num.text = m_curNum.ToString(); Label_Introduction.text = LanguageTextManager.GetString(m_MedicamentData._szDesc).Replace(@"\n", "\n"); Label_SellPrice.text = m_MedicamentData._SaleCost.ToString(); m_GiftConfigData = ItemDataManager.Instance.GetGiftData(m_curGoodID); if (m_GiftConfigData._giftType == 1) { Label_ContentTitle.text = LanguageTextManager.GetString("IDS_I1_40"); } else if (m_GiftConfigData._giftType == 2) { Label_ContentTitle.text = LanguageTextManager.GetString("IDS_I1_41"); } // transform.localPosition = Vector3.zero; //奖品 string content = ""; var goodsDisplay = m_GiftConfigData._ProfessionGoodsDisplay.SingleOrDefault(p => p.Profession == PlayerManager.Instance.FindHeroDataModel().GetCommonValue().PLAYER_FIELD_VISIBLE_VOCATION); for (int i = 0; i < goodsDisplay.GoodsDisplay.Length; i++) { var ItemData = ItemDataManager.Instance.GetItemData(goodsDisplay.GoodsDisplay[i].GoodsID); // if(m_GiftConfigData._giftType == 1) // { // content += LanguageTextManager.GetString(ItemData._szGoodsName) + "(" // +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+ "~" // +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+")" + "\n"; // } // else if(m_GiftConfigData._giftType == 2) // { // content += LanguageTextManager.GetString(ItemData._szGoodsName) + "(" // +m_GiftConfigData._GoodsDisplay[i].MinNum.ToString()+")" + "\n"; // } if (goodsDisplay.GoodsDisplay[i].MinNum == goodsDisplay.GoodsDisplay[i].MaxNum) { content += LanguageTextManager.GetString(ItemData._szGoodsName) + " X " + goodsDisplay.GoodsDisplay[i].MinNum.ToString() + "\n"; } else { content += LanguageTextManager.GetString(ItemData._szGoodsName) + " X " + goodsDisplay.GoodsDisplay[i].MinNum.ToString() + "-" + goodsDisplay.GoodsDisplay[i].MaxNum.ToString() + "\n"; } } Label_RewardContent.text = content; }
public void InsertBtn(MainTownButtonConfigData item)//MainUI.UIType sysBtnType, MainBtnArea btnPos, int btnNum)//插入按钮,按钮位置,按钮序号,按钮序号从0开始 { //print("原预添加位置:"+btnNum); // if (item._ButtonIndex > btnArray.Count) // { // item._ButtonIndex = btnArray.Count; // } //print("实际添加位置:" +btnNum); LocalSysButton localBtnController = CreatObjectToNGUI.InstantiateObj(item.ButtonPrefab, transform).GetComponent <LocalSysButton>(); localBtnController.gameObject.RegisterBtnMappingId(item.ButtonFunc, BtnMapId_Sub.Empty); //new switch (item.ButtonArea) { case MainTownButtonArea.LeftUp: for (int i = 0; i < 10; i++) { if (i == item.Button_Row - 1) { if (m_insertLeftUpIFirst[i]) { m_insertLeftUpPos_x[i] = CommonDefineManager.Instance.CommonDefine.TownstartPoint1.BaseOffset.x; m_insertLeftUpIFirst[i] = false; //m_insertLeftUpPos_y=CommonDefineManager.Instance.CommonDefine.TownstartPoint1.BaseOffset.y; } else { m_insertLeftUpPos_x[i] += (item.ButtonRadius + m_insertLeftUpRadio[i]) * CommonDefineManager.Instance.CommonDefine.TownstartPoint1.Direction.x; } m_insertLeftUpPos_y = item.Button_RowIndex * CommonDefineManager.Instance.CommonDefine.TownstartPoint1.Direction.y; m_insertLeftUpRadio[i] = item.ButtonRadius; localBtnController.SetBtnAtrribute(item.ButtonFunc, new Vector3(m_insertLeftUpPos_x[i], m_insertLeftUpPos_y, 0), this.Showing, item.DefaultEnable == 1, item.ButtonSound); } } break; case MainTownButtonArea.RightUp: for (int i = 0; i < 10; i++) { if (i == item.Button_Row - 1) { if (m_insertRightUpFirst[i]) { m_insertRightUpPos_x[i] = CommonDefineManager.Instance.CommonDefine.TownstartPoint2.BaseOffset.x; m_insertRightUpFirst[i] = false; // m_insertRightUpPos_y=CommonDefineManager.Instance.CommonDefine.TownstartPoint2.BaseOffset.y; } else { m_insertRightUpPos_x[i] += (item.ButtonRadius + m_insertRightUpRadio[i]) * CommonDefineManager.Instance.CommonDefine.TownstartPoint2.Direction.x; } m_insertRightUpPos_y = item.Button_RowIndex * CommonDefineManager.Instance.CommonDefine.TownstartPoint2.Direction.y; m_insertRightUpRadio[i] = item.ButtonRadius; localBtnController.SetBtnAtrribute(item.ButtonFunc, new Vector3(m_insertRightUpPos_x[i], m_insertRightUpPos_y, 0), this.Showing, item.DefaultEnable == 1, item.ButtonSound); } } break; case MainTownButtonArea.RightDown: for (int i = 0; i < 10; i++) { if (i == item.Button_Row - 1) { if (m_insertRightDownFirst[i]) { if (i == 0) { m_insertRightDownPos_x[i] = CommonDefineManager.Instance.CommonDefine.TownstartPoint3.BaseOffset.x; } else { m_insertRightDownPos_x[i] = 0; } m_insertRightDownFirst[i] = false; // m_insertRightDownPos_y=CommonDefineManager.Instance.CommonDefine.TownstartPoint2.BaseOffset.y; } else { m_insertRightDownPos_x[i] += (item.ButtonRadius + m_insertRightDownRadio[i]) * CommonDefineManager.Instance.CommonDefine.TownstartPoint3.Direction.x; } m_insertRightDownPos_y = item.Button_RowIndex * CommonDefineManager.Instance.CommonDefine.TownstartPoint3.Direction.y; m_insertRightDownRadio[i] = item.ButtonRadius; localBtnController.SetBtnAtrribute(item.ButtonFunc, new Vector3(m_insertRightDownPos_x[i], m_insertRightDownPos_y, 0), this.Showing, item.DefaultEnable == 1, item.ButtonSound); } } break; default: break; } //localBtnController.SetBtnAtrribute(item.ButtonFunc, new Vector3(item.ButtonPositionOffset.x, item.ButtonPositionOffset.y, 0), this.Showing,item.DefaultEnable==1); //引导注入 #region old // switch (item._ButtonArea) // { // case MainBtnArea.TopLeft: // // m_insertBottomPos += -(item._ButtonRadius * 2); // localBtnController.SetBtnAtrribute(item._ButtonFunc, new Vector3(item._ButtonIndex.x, item._ButtonIndex.y, 0), this.Showing); // break; // case MainBtnArea.TopRight: // m_insertRightPos += (item._ButtonRadius * 2); // localBtnController.SetBtnAtrribute(item._ButtonFunc, new Vector3(0, m_insertRightPos, 0), this.Showing); // break; // default: // break; // } #endregion ///ssss btnArray.Add(localBtnController); //ResetBtnPosition(); int guideID = 0; //TODO GuideBtnManager.Instance.RegGuideButton(localBtnController.gameObject, item._ButtonFunc, SubType.MainButton, out guideID); m_guideBtnID.Add(guideID); }
/// <summary> /// 处理开放主按钮消息,播放开启特效 /// </summary> /// <param name="obj"></param> void AddMainButton(object obj) { m_addSystemFunc = (UIType)obj; var buttonList = NewUIDataManager.Instance.TownMainButtonList; MainTownButtonConfigData enableItem = null; //找到要开放的功能按钮配置信息 for (int i = 0; i < buttonList.Count; i++) { if (buttonList[i].ButtonFunc == m_addSystemFunc) { enableItem = buttonList[i]; } } if (enableItem == null) { TraceUtil.Log("要开启主按钮,配置表中无对应!"); return; } //加入到已开放功能按钮配置信息列表 if (!m_buttonList.Exists(P => P.ButtonFunc == enableItem.ButtonFunc)) { m_buttonList.Add(enableItem); } else { TraceUtil.Log("此功能按钮已经开启!"); } //SysButtonPanel_Bottom.ResetSystemPanel(); //SysButtonPanel_Right.ResetSystemPanel(); m_buttonList.Sort(SortBtn); switch (enableItem.ButtonArea) { case MainTownButtonArea.LeftUp: SysButtonPanel_TopLeft.RestPanel(); break; case MainTownButtonArea.RightUp: SysButtonPanel_TopRight.RestPanel(); break; case MainTownButtonArea.RightDown: SysButtonPanel_BottomRight.RestPanel(); break; } if (m_buttonEnablePic != null) { Destroy(m_buttonEnablePic); } foreach (var item in m_buttonList) { //AddSysFuntionButton(item); if (item.ButtonFunc == m_addSystemFunc) { TraceUtil.Log("开启新功能:" + m_addSystemFunc + " " + Time.realtimeSinceStartup); m_buttonEnablePic = CreatObjectToNGUI.Instantiate(ButtonEnablePic) as GameObject; m_buttonEnablePic.transform.parent = this.transform.parent; m_buttonEnablePic.transform.localScale = Vector3.one; m_buttonEnablePic.GetComponent <EnableFunctionPanel>().InitPanel(m_addSystemFunc, SysButton.transform, this); } } StartCoroutine(Creat()); }