void DestroyUnlock(GameObject go) { go.SetActive(false); GameObject Obj = go.transform.parent.gameObject.transform.parent.gameObject; if (!Obj) { return; } UIButton MapBtn = Obj.GetComponent <UIButton>(); if (!MapBtn) { return; } UIAtlasHelper.SetButtonImage(MapBtn, go.transform.parent.gameObject.name, true); UILabel Condition = ObjectCommon.GetChildComponent <UILabel>(Obj, "condition"); Condition.gameObject.SetActive(false); Condition.text = ""; go.transform.parent.gameObject.SetActive(false); UpdateAnimation(); }
void SetData(ChargeItemInfo info) { if (info == null) { IconSprite.spriteName = ""; CountLabel.text = ""; TitleLabel.text = ""; return; } ItemTableItem item = ItemManager.GetItemRes(info.itemId); if (item == null) { Debug.LogError("物品表中不存在的物品id=" + info.itemId); return; } TitleLabel.text = info.title; CountLabel.text = info.count.ToString(); NameLabel.text = ItemManager.getItemNameWithColor(info.itemId); UIAtlasHelper.SetSpriteImage(IconSprite, item.picname, true); }
public void SetDaChengPicVisable(int condition) { for (int i = 0; i < WingDefine.MaxConditonNum; i++) { if ((condition & (1 << i)) == 0) //没有达成条件i+1 { if (mDaChengPicList[i].atlas.name == "chibangjiesuoblue") { mDaChengPicList[i].transform.localEulerAngles = new Vector3(0, 0, 143); mDaChengPicList[i].transform.localPosition = new Vector3(2.73f, 1.22f, 0); } UIAtlasHelper.SetSpriteImage(mDaChengPicList[i], "chibangjiesuored:jm_chibangjiesuo1_00000"); UISpriteAnimation sa = mDaChengPicList[i].GetComponent <UISpriteAnimation>(); sa.RebuildSpriteList(); sa.Reset(); } else { if (mDaChengPicList[i].atlas.name == "chibangjiesuored") { mDaChengPicList[i].transform.localEulerAngles = Vector3.zero; mDaChengPicList[i].transform.localPosition = Vector3.zero; } UIAtlasHelper.SetSpriteImage(mDaChengPicList[i], "chibangjiesuoblue:jm_chibangjiesuo2_00000"); UISpriteAnimation sa = mDaChengPicList[i].GetComponent <UISpriteAnimation>(); sa.RebuildSpriteList(); sa.Reset(); } } }
private void CreateWingItem(int index) { GameObject go = UIResourceManager.Instance.CloneGameObject(wingItemProfab); if (go == null) { GameDebug.Log("wingItemProfab not found"); } UIEventListener.Get(go).onDrag = OnWingItemDrag; UIEventTrigger et = go.GetComponent <UIEventTrigger>(); EventDelegate.Add(et.onPress, OnWingItemPress); EventDelegate.Add(et.onRelease, OnWingItemRelease); go.SetActive(true); go.name = index.ToString(CultureInfo.InvariantCulture); go.transform.parent = winggrid.transform; go.transform.localScale = Vector3.one; WingItemUI tempItem = new WingItemUI(go); var commonRes = DataManager.WingCommonTable[mWingMoudle.GetWingIdByIndex(index)] as WingCommonTableItem; UIAtlasHelper.SetSpriteImage(tempItem.mWingSprite, commonRes.wingPicLow); mWingItemUIList.Add(tempItem); //tempItem.mWingPicAni = AnimationManager.Instance.CreateParticleAnimation(4, go); // GameDebug.Log(commonRes.wingPicAni); // tempItem.mWingPicAni.gameObject.SetActive(true); // tempItem.mWingPicAni.RebuildSpriteList(); // tempItem.mWingPicAni.Reset(); }
// 更新情节 public void UpdateTalk(bool top, string text) { mTimer = 3.0f; UIAtlasHelper.SetSpriteImage(mHead, "meizi:meizi"); if (!top) { mHead.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f)); } else { mHead.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 180.0f, 0.0f)); } mBtn.alpha = 0.0f; StopEffect(); if (top) { LeftMode(); } else { RightMode(); } ShowText(text); }
public void UpdateUI() { for (int i = 0; i < mCurPageNum; ++i) { int pageIndex = i + 1; if (pageIndex < mLockPage && mCurPage != pageIndex) //已解锁不是当前页 { UIAtlasHelper.SetSpriteImage(mPageList[i], "wing0:wing0-011"); } else if (pageIndex < mLockPage && mCurPage == pageIndex) //已解锁是当前页 { UIAtlasHelper.SetSpriteImage(mPageList[i], "wing0:wing0-012"); } else if (pageIndex >= mLockPage && mCurPage != pageIndex) { UIAtlasHelper.SetSpriteImage(mPageList[i], "wing0:wing0-014"); } else if (pageIndex >= mLockPage && mCurPage == pageIndex) { UIAtlasHelper.SetSpriteImage(mPageList[i], "wing0:wing0-013"); } else { GameDebug.LogError("设置LockStatePageBarUI图片异常"); } } }
/*设置试衣间*/ //1.佣兵星级和名称 private void SetCurSelecteStarsLv(int resid) { PlayerDataModule pmodule = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (null == pmodule) { return; } CropsTableItem item = DataManager.CropsTable[resid] as CropsTableItem; if (null == item) { return; } mCropsName.text = item.name; int starslv = pmodule.GetCropsStarsLv(resid) == -1 ? 1 : pmodule.GetCropsStarsLv(resid); for (int i = 0; i < starslv; ++i) { UIAtlasHelper.SetSpriteImage(mStarsList[i], "common:strenth (11)"); } for (int i = starslv; i < STARSMAX; ++i) { UIAtlasHelper.SetSpriteImage(mStarsList[i], "common:starslvback"); } }
private void RefreshListPanel() { isDirty = false; FashionItemData itemdata; foreach (var kvp in mItemDic) { FashionTableItem res = DataManager.FashionTable[kvp.Key] as FashionTableItem; if (mModule.GetEquipId(res.bodypart) == kvp.Key) //已穿戴 { GameDebug.Log("kpv.key" + kvp.Key); kvp.Value.flag.gameObject.SetActive(true); kvp.Value.flagTxt.text = StringHelper.GetString("equiped"); } else { kvp.Value.flag.gameObject.SetActive(false); } if (mModule.GetFashionByID(kvp.Key, out itemdata)) { //已经获得 kvp.Value.mLock.gameObject.SetActive(false); UIAtlasHelper.SetButtonImage(kvp.Value.mBtn, "Shizhuang:shizhuang_02"); } else { kvp.Value.mLock.gameObject.SetActive(true); UIAtlasHelper.SetButtonImage(kvp.Value.mBtn, "Shizhuang:shizhuang_04"); } } mFashionItemGrid.repositionNow = true; RefresItemInfo(); }
public void SetRankingInfo(RankingInfo info, int top, bool self = false) { mInfo = info; if (top < 3) { UIAtlasHelper.SetSpriteImage(mIcon, "common:top" + (top + 1).ToString()); mIcon.gameObject.SetActive(true); mIconLabel.gameObject.SetActive(false); mName.color = NGUIMath.HexToColor(0xfcff00ff); } else { mIconLabel.text = (top + 1).ToString(); mIcon.gameObject.SetActive(false); mIconLabel.gameObject.SetActive(true); mName.color = NGUIMath.HexToColor(0xffffffff); } mName.text = "Lv." + mInfo.level.ToString() + " " + mInfo.name; mGrade.text = info.grade.ToString(); mArenaPoint.text = info.score.ToString(); if (self) { mSelectBK.gameObject.SetActive(true); mSelfSprite.gameObject.SetActive(true); } else { mSelectBK.gameObject.SetActive(false); mSelfSprite.gameObject.SetActive(false); } }
private void SetIcon(string icon) { if (mIcon != null) { UIAtlasHelper.SetSpriteImage(mIcon, icon); } }
private void SetParam1(string param) { if (mSprite1 != null) { UIAtlasHelper.SetSpriteImage(mSprite1, param); } }
void updateEggCostInfo() { PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (pdm == null) { return; } for (int i = 0; i < EggModule.EGG_COUNT; i++) { EggType et = (EggType)(i + 1); int num = EggModule.getCostProcNum(et); ProceedsType pt = EggModule.getCostProcType(et); if (pt == ProceedsType.Invalid || num <= 0) { costLb[i].transform.parent.gameObject.SetActive(false); } else { if (pdm.GetProceeds(pt) < num) { costLb[i].text = StringHelper.StringWithColor(FontColor.Red, num.ToString()); } else { costLb[i].text = num.ToString(); } UIAtlasHelper.SetSpriteByMoneyType(costSp[i], pt, false); costLb[i].transform.parent.gameObject.SetActive(true); } } }
private void OnClickItem() { if (isOpened == false) { isOpened = true; if (!NGUITools.GetActive(mStateOpen.gameObject)) { NGUITools.SetActive(mStateOpen.gameObject, true); } if (NGUITools.GetActive(mStateClose.gameObject)) { NGUITools.SetActive(mStateClose.gameObject, false); } MailActionParam param = new MailActionParam(); param.mailid = mMaildata.mailid; Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_MAIL_STATE_OPENED, param); } MailModule module = ModuleManager.Instance.FindModule <MailModule>(); module.SelectedMail = this; ShowMailContent(mMaildata); UIWindow MailUI = WindowManager.Instance.GetUI("mail"); UIButton mDeleteBtn = MailUI.FindComponent <UIButton>("background/mGiveUpBtn"); UIButton mPickBtn = MailUI.FindComponent <UIButton>("background/mGetBtn"); UIAtlasHelper.SetButtonImage(mDeleteBtn, "common:btn_blue_4word", true); if (mMaildata.itemcnt > 0 && mMaildata.mItemsList != null && !isPicked) { UIAtlasHelper.SetButtonImage(mPickBtn, "common:btn_yellow_4word", true); } }
public void SetStarslv(int starslv) { for (int i = 0; i < starslv; ++i) { UIAtlasHelper.SetSpriteImage(mStarsList[i], "common:strenth (11)"); } }
public void SetShowInfo(int rankNum, int resId, int level, string name, uint score, uint floor) { if (rankNum > 3) { mRankNum.gameObject.SetActive(true); mRankIcon.gameObject.SetActive(false); mRankNum.text = rankNum.ToString(); } else { mRankNum.gameObject.SetActive(false); mRankIcon.gameObject.SetActive(true); UIAtlasHelper.SetSpriteImage(mRankIcon, "common:top" + rankNum); } PlayerTableItem playrRes = DataManager.PlayerTable[resId] as PlayerTableItem; if (playrRes != null) { UIAtlasHelper.SetSpriteImage(mHeadIcon, playrRes.face); } mPlayerName.text = "LV." + level + " " + name; mFloor.text = floor + StringHelper.GetString("ceng"); mScore.text = score.ToString(); }
private void SetStarBar(int starCount) { for (int i = 0; i < startIconList.Count; ++i) { UIAtlasHelper.SetSpriteImage(startIconList[i], i < starCount ? "common:strenth (8)" : "common:hei_xing"); } }
public void SetIcon(string icon) { if (mIcon) { UIAtlasHelper.SetSpriteImage(mIcon, icon, true); } }
public void SetIcon(string Icon = "") { if (mIcon) { UIAtlasHelper.SetSpriteImage(mIcon, Icon); } }
private void UpdateEquips() { PackageManager pack = mDataModule.GetPackManager(); Dictionary <int, ItemObj> dic = pack.getPackDic(PackageType.Pack_Equip); for (int i = 0; i < (int)EquipSlot.EquipSlot_MAX; ++i) { if (dic.ContainsKey(i)) { UpdateSingleEquip(i, dic[i]); } else { UpdateSingleEquip(i, null); } } PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (module == null) { return; } int mainWeaponid = mDataModule.GetMainWeaponId(); if (!DataManager.WeaponTable.ContainsKey(mainWeaponid)) { return; } WeaponObj wobj = module.GetItemByID(mainWeaponid, PackageType.Pack_Weapon) as WeaponObj; if (wobj == null) { return; } WeaponTableItem res = DataManager.WeaponTable[mainWeaponid] as WeaponTableItem; UIAtlasHelper.SetButtonImage(mWeaponIcon, res.picname); mWeaponSterLv.text = "+" + wobj.GetWeaponLv().ToString(); mWeaponPromoteLv.text = wobj.GetPromoteLv().ToString(); UIAtlasHelper.SetSpriteImage(mWeaponLvPic, wobj.GetWeaponLvPic()); string zhishi = wobj.GetWeaponGradePic(); if (string.IsNullOrEmpty(zhishi)) { UIAtlasHelper.SetSpriteImage(mWeaponGradeBg, "common:weaponlvbg1"); } else { UIAtlasHelper.SetSpriteImage(mWeaponGradeBg, "common:weaponlvbg2"); } UIAtlasHelper.SetSpriteImage(mWeaponGradePic, zhishi); }
private void OnRewardBtnClick() { if (!picked) { Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_FIRST_CHARGE_REWARD, null); UIAtlasHelper.SetButtonImage(mGetRewardBtn, "common:anniuhui", true); picked = true; } }
// 更新情节 public void UpdateStory(StoryTableItem res) { if (mRes == null) { mTimer = 0.0f; } else { mTimer = 3.0f; } mRes = res; mStepWaitTime = (float)(mRes.keepTime * 0.001); if (mRes.headAtlas.Equals("player")) { PlayerDataModule module = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (module != null) { UIAtlasHelper.SetSpriteImage(mHead, "touxiang:player_" + module.GetResId().ToString()); } } else { UIAtlasHelper.SetSpriteImage(mHead, mRes.headAtlas); } if (mRes.headMirror < 1) { mHead.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 0.0f, 0.0f)); } else { mHead.transform.localRotation = Quaternion.Euler(new Vector3(0.0f, 180.0f, 0.0f)); } // mTitle.text = mRes.title; // mContent.text = mRes.content; mBtn.alpha = 0.0f; StopEffect(); if (mRes.headPos == 0 || mRes.headPos == 2) { LeftMode(); } else if (mRes.headPos == 1 || mRes.headPos == 3) { RightMode(); } else { MiddleMode(); } mState = UIState.STATE_0; }
// 清理 public void Clear() { UIAtlasHelper.SetSpriteImage(mHead, null); mTitle.text = null; mContent.text = null; mWidget.alpha = 0.0f; mTimer = 0.0f; mState = UIState.STATE_ORIGINAL; }
protected override void OnLoad() { base.OnLoad(); mFashionName = FindComponent <UILabel>("listContiner/namebg/fashionname"); mGetWay = FindComponent <UILabel>("listContiner/getway"); mDesc = FindComponent <UILabel>("listContiner/desc"); mPropTitle = FindComponent <UILabel>("listContiner/proptitle"); mDefence = FindComponent <UILabel>("listContiner/defence"); mAttack = FindComponent <UILabel>("listContiner/attack"); mPower = FindComponent <UILabel>("listContiner/power"); mLife = FindComponent <UILabel>("listContiner/life"); mCritical = FindComponent <UILabel>("listContiner/critical"); mAddStarBtn = FindComponent <UIButton>("listContiner/btngrid/AddstarBtn"); mWearBtn = FindComponent <UIButton>("listContiner/btngrid/EquipBtn"); mWearTxt = FindComponent <UILabel>("listContiner/btngrid/EquipBtn/Label"); mBuyBtn = FindComponent <UIButton>("listContiner/btngrid/BuyBtn"); mBuyText = FindComponent <UILabel>("listContiner/btngrid/BuyBtn/Label"); mBtnGrid = FindComponent <UIGrid>("listContiner/btngrid"); mFashionItemGrid = FindComponent <UIGrid>("listContiner/ScrollView/itemgrid"); ownItemNum = FindComponent <UILabel>("listContiner/ownItemNum"); mExamFashionItem = FindChild("FashionItem"); mExamFashionItem.SetActive(false); mAwardContainer = FindChild("awardContainer"); mPreview = FindComponent <UISprite>("listContiner/Preview"); mCharacterPreview = new UICharacterPreview(); //初始化时装列表 mItemDic = new Dictionary <int, FashionItemUI>(); IDictionaryEnumerator enumerator = DataManager.FashionTable.GetEnumerator(); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (pdm == null) { return; } while (enumerator.MoveNext()) { FashionTableItem res = enumerator.Value as FashionTableItem; if (res.sex != pdm.GetResId()) { continue; } FashionItemUI item = new FashionItemUI(GameObject.Instantiate(mExamFashionItem) as GameObject); UIAtlasHelper.SetSpriteImage(item.cloth, res.pic); item.gameObject.SetActive(true); item.gameObject.transform.parent = mFashionItemGrid.gameObject.transform; item.gameObject.transform.localScale = Vector3.one; item.name.text = res.name; item.mBtn.CustomData = res.id; mItemDic.Add(res.id, item); } mFashionItemGrid.maxPerLine = mItemDic.Count > 8 ? Mathf.CeilToInt(mItemDic.Count / 2) : 4; mPropTitle.text = StringHelper.GetString("fashion_pro"); }
//判断是否获得成就 private void RefreshAchieveMent(int floor) { // UIAtlasHelper.SetSpriteGrey(mSpriteAchieveOne, !mChalModule.IsGainAchievement(floor, 0)); // UIAtlasHelper.SetSpriteGrey(mSpriteAchieveTwo, !mChalModule.IsGainAchievement(floor, 1)); // UIAtlasHelper.SetSpriteGrey(mSpriteAchieveThree, !mChalModule.IsGainAchievement(floor, 2)); UIAtlasHelper.SetSpriteGrey(mSpriteAchieveOne, false); UIAtlasHelper.SetSpriteGrey(mSpriteAchieveTwo, false); UIAtlasHelper.SetSpriteGrey(mSpriteAchieveThree, false); }
//设置具体信息 //type:0待买 显示声望, 1待买 显示金钱, 2拥有 ,3装备, 4待买 显示钻石, 5待买 显示道具数量 //color:false红色 public void SetInfo(int type, string value, bool color, string picname = "") { if (type == 0) { mGame.gameObject.SetActive(false); mPre.gameObject.SetActive(true); mBack.gameObject.SetActive(true); mDiamond.gameObject.SetActive(false); mItem.gameObject.SetActive(false); } else if (type == 1) { mGame.gameObject.SetActive(true); mPre.gameObject.SetActive(false); mBack.gameObject.SetActive(true); mDiamond.gameObject.SetActive(false); mItem.gameObject.SetActive(false); } else if (type == 4) { mGame.gameObject.SetActive(false); mPre.gameObject.SetActive(false); mBack.gameObject.SetActive(true); mDiamond.gameObject.SetActive(true); mItem.gameObject.SetActive(false); } else if (type == 5) { mGame.gameObject.SetActive(false); mPre.gameObject.SetActive(false); mBack.gameObject.SetActive(true); mDiamond.gameObject.SetActive(false); mItem.gameObject.SetActive(true); UIAtlasHelper.SetSpriteImage(mItem, picname); } else { mGame.gameObject.SetActive(false); mPre.gameObject.SetActive(false); mBack.gameObject.SetActive(false); mDiamond.gameObject.SetActive(false); mItem.gameObject.SetActive(false); } mDesc.text = value; if (color) { mDesc.color = Color.white; } else { mDesc.color = Color.red; } }
private void OnDeleteBtnClick() { MailModule module = ModuleManager.Instance.FindModule <MailModule>(); if (module.SelectedMail != null) { module.SelectedMail.OnDeleteItem(); } UIAtlasHelper.SetButtonImage(mDeleteBtn, "common:anniuhui", true); }
public void ClearUI() { mInfoText.text = null; mBattleGradeText.text = null; mRankingText.text = null; UIAtlasHelper.SetSpriteImage(mRoleIcon, null); this.gameObject.SetActive(false); }
public void SetTitle(string spriteInfo) { if (string.IsNullOrEmpty(spriteInfo)) { titleSp.gameObject.SetActive(false); return; } UIAtlasHelper.SetSpriteImage(titleSp, spriteInfo, true); titleSp.gameObject.SetActive(true); }
//刷新成就 private void RefreshAchieveMent(bool show) { mSpriteChengjiuBg.gameObject.SetActive(show); if (!show) { return; } UIAtlasHelper.SetSpriteGrey(mSpriteAchieveOne, !mCompleteOne); UIAtlasHelper.SetSpriteGrey(mSpriteAchieveTwo, !mCompleteTwo); UIAtlasHelper.SetSpriteGrey(mSpriteAchieveThree, !mCompleteThree); }
// 更新战区图标 private void UpdateZoneIcon() { UISprite sprite = mZoneIcon.GetComponent <UISprite>(); if (sprite == null) { return; } //UIAtlasHelper.SetSpriteImage(sprite, "stage_zone_" + mModule.ZoneId.ToString()); UIAtlasHelper.SetSpriteName(sprite, "stage_zone_" + mModule.ZoneId.ToString()); }