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); } }
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); }
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 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图片异常"); } } }
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(); } } }
public void SetIcon(string icon) { if (mIcon) { UIAtlasHelper.SetSpriteImage(mIcon, icon, true); } }
private void SetParam1(string param) { if (mSprite1 != null) { UIAtlasHelper.SetSpriteImage(mSprite1, param); } }
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(); }
/*设置试衣间*/ //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 SetStarBar(int starCount) { for (int i = 0; i < startIconList.Count; ++i) { UIAtlasHelper.SetSpriteImage(startIconList[i], i < starCount ? "common:strenth (8)" : "common:hei_xing"); } }
private void SetIcon(string icon) { if (mIcon != null) { UIAtlasHelper.SetSpriteImage(mIcon, icon); } }
public void SetStarslv(int starslv) { for (int i = 0; i < starslv; ++i) { UIAtlasHelper.SetSpriteImage(mStarsList[i], "common:strenth (11)"); } }
// 更新情节 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 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); }
// 清理 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"); }
// 更新情节 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; }
//设置具体信息 //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; } }
public void SetTitle(string spriteInfo) { if (string.IsNullOrEmpty(spriteInfo)) { titleSp.gameObject.SetActive(false); return; } UIAtlasHelper.SetSpriteImage(titleSp, spriteInfo, true); titleSp.gameObject.SetActive(true); }
public void ClearUI() { mInfoText.text = null; mBattleGradeText.text = null; mRankingText.text = null; UIAtlasHelper.SetSpriteImage(mRoleIcon, null); this.gameObject.SetActive(false); }
void setCurTitle(int titleId) { TitleItemTableItem item = TitleModule.GetTitleItemById(titleId); if (item == null) { return; } UIAtlasHelper.SetSpriteImage(mIconSp, item.picName, true); mAttrisLb[0].text = item.detail1; mAttrisLb[1].text = item.detail2; mAttrisLb[2].text = item.detail3; mAttrisLb[3].text = item.detail4; mGradeLb.text = item.grade.ToString(); PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>(); if (pdm == null) { return; } bool ishave = pdm.IsHasTitleByID(titleId); string detail = ""; switch (item.contentId) { case 0: FontColor fc = ishave ? FontColor.Green : FontColor.Red; string tmp = StringHelper.StringWithColor(fc, pdm.GetLevel() + "/" + item.conditionVal); detail = string.Format(item.contentDetail, tmp); break; default: detail = item.contentDetail; break; } mConditionLb.text = detail; UISprite btnBg = mEquipBtn.GetComponent <UISprite>(); if (btnBg != null) { UIAtlasHelper.SetSpriteShaderGrey(btnBg, !ishave); } mEquipBtnLb.text = pdm.GetCurTitle() == titleId ? "卸下" : "穿戴"; }
public void UpdateInfo(int type, int ResId, string name, int needLevel, int playerLevel, int openTime, int closeTime, int leftCount, bool completed, string desc, string scenebg) { bool enable = true; mType = type; mResId = ResId; mActivityName.text = name; if (needLevel > playerLevel) { enable = false; mNeedLevel.text = "[e92224]" + needLevel.ToString() + "级"; } else { mNeedLevel.text = "[fed514]" + needLevel.ToString() + "级"; } if (!isOpenTime(openTime, closeTime)) { enable = false; mActivityTime.text = "[e92224]" + FormatTime(openTime, closeTime); } else { mActivityTime.text = "[fed514]" + FormatTime(openTime, closeTime); } if (leftCount <= 0) { enable = false; mLeftCount.text = "[ff0000]" + leftCount.ToString(); } else { mLeftCount.text = "[81ffa5]" + leftCount.ToString(); } mDesc.text = desc; mCompleted.gameObject.SetActive(completed); mOkBtn.isEnabled = enable && !completed; if (!mOkBtn.isEnabled) { mOkLabel.text = "[423e3e]" + "开始挑战"; } else { mOkLabel.text = "[5d230c]" + "开始挑战"; } UIAtlasHelper.SetSpriteImage(mback, scenebg, true); }
private void SetStonePic(string pic) { if (mGemIcon == null) { return; } UIAtlasHelper.SetSpriteImage(mGemIcon, pic); NGUITools.SetActive(mGemIcon.gameObject, true); if (mGemAni == null && pic != null) { mGemAni = AnimationManager.Instance.AddSpriteAnimation("xingguanshandong", mGemIcon.gameObject, mGemIcon.depth + 1, 30); } }
private void OnStart() { if (!DataManager.TitleItemTable.ContainsKey(mCurTitleID)) { return; } TitleItemTableItem item = TitleModule.GetTitleItemById(mCurTitleID); UIAtlasHelper.SetSpriteImage(mIcon, item.picName, true); mLabel.text = StringHelper.GetString("get_new_title") + item.name; mWaitingTime = 3000; mWaiting = true; }
private void OnStart() { if (!DataManager.MenuTable.ContainsKey(mCurFunctionID)) { return; } MenuTableItem item = DataManager.MenuTable[mCurFunctionID] as MenuTableItem; UIAtlasHelper.SetSpriteImage(mIcon, item.icon); mLabel.text = "新功能开启 : " + item.desc; mWaitingTime = 3000; mWaiting = true; }
protected override void OnOpen(object param = null) { base.OnOpen(); chooseMode = true; EventDelegate.Add(mStartBtn.onClick, OnStartBtnClick); if (chooseMode == true) { OnCreateChargeItem(); mStartBtnLab.text = "VIP"; UIAtlasHelper.SetSpriteImage(mIcon, "chongzhi:chongzhi_10", true); NGUITools.SetActive(mChargebk.gameObject, true); } }
public void updateline(bool isActive, int index = 1) { if (isActive) { mMapLine.gameObject.SetActive(true); UIAtlasHelper.SetSpriteImage(mMapLine, "citymap:citymap_xianlu" + index.ToString(), true); } else { mMapLine.gameObject.SetActive(false); UIAtlasHelper.SetSpriteImage(mMapLine, "", true); } }
// 翻牌 public void Award(string icon, string txt) { UIAtlasHelper.SetSpriteImage(mAwardIcon, icon); mAwardText.text = txt; mAwardTweener.Play(); mMaskTweener.Play(); mAni.gameObject.SetActive(true); mAni.onFinished += OnAniFinished; SoundManager.Instance.Play(107); mAwarded = true; }
void UpdateInfo() { BaseScene bs = SceneManager.Instance.GetCurScene(); if (bs == null) { slider.transform.parent.gameObject.SetActive(true); slider2.transform.parent.gameObject.SetActive(false); } else { //int resId = bs.GetSceneResId(); //if(!DataManager.SceneTable.ContainsKey(resId)) // return; //SceneTableItem sti = DataManager.SceneTable[resId] as SceneTableItem; SceneTableItem sti = bs.GetSceneRes(); if (sti == null) { return; } switch (SceneManager.GetSceneType(sti)) { case SceneType.SceneType_City: //主城; slider.transform.parent.gameObject.SetActive(true); slider2.transform.parent.gameObject.SetActive(false); break; case SceneType.SceneType_Stage: //关卡场景; case SceneType.SceneType_Tower: case SceneType.SceneType_Zombies: case SceneType.SceneType_MonsterFlood: case SceneType.SceneType_QiangLinDanYu: case SceneType.SceneType_Mao: case SceneType.SceneType_HunNeng: slider.transform.parent.gameObject.SetActive(false); slider2.transform.parent.gameObject.SetActive(true); bossNameLb.text = sti.bossName; bossDetailLb.text = sti.bossDetail; UIAtlasHelper.SetSpriteImage(bossSp, sti.bossSprite, true); break; default: break; } } }