public void UpLevel() { if (MyHead.togUpLevel.value) { MyHead.UpStar.SetActive(false); MyHead.UpLevel.SetActive(true); MyHead.BtnUpStar.gameObject.SetActive(false); MyHead.btnUp.gameObject.SetActive(true); MyHead.LblNextName.text = NGUIUtil.GetStringByKey(10000154); //MyHead.btnUp.isEnabled = false; if (m_CurItem != null) { m_CurItem.ResetUI(); MyHead.LblStarName.text = ""; MyHead.lblName.text = "[71fff0]" + m_CurItem.Godskill.m_name + "[-] [ffff62]" + NGUIUtil.GetStringByKey("60000005") + m_CurItem.m_caption.m_level1 + "[-]"; if (m_CurItem.Godskill.m_coinneed == 0 && m_CurItem.Godskill.m_crystalneed == 0) { MyHead.lblExplain.text = NGUIUtil.GetStringByKey(10000122); } else { MyHead.lblExplain.text = string.Format("[552d0a]" + m_CurItem.Godskill.m_explain + "[-]"); } MyHead.lblGoldCost.text = m_CurItem.Godskill.m_coinneed.ToString(); if (UserDC.GetCoin() >= m_CurItem.Godskill.m_coinneed) { MyHead.lblGoldCost.color = Color.white; } else { MyHead.lblGoldCost.color = Color.red; } MyHead.lblDiamondCost.text = m_CurItem.Godskill.m_crystalneed.ToString(); if (UserDC.GetCrystal() >= m_CurItem.Godskill.m_crystalneed) { MyHead.lblDiamondCost.color = Color.white; } else { MyHead.lblDiamondCost.color = Color.red; } m_CurItem.CheckUp(); // MyHead.btnUp.isEnabled = m_CurItem.CheckLevTop() && m_CurItem.m_CanLevUP; GodSkillInfo nextInfo = new GodSkillInfo(); GodSkillM.GetGodSkill(m_CurItem.Godskill.m_type, m_CurItem.Godskill.m_level + 1, ref nextInfo); if (nextInfo != null && nextInfo.m_explain != null) { MyHead.NextStarDes.text = string.Format("[552d0a]" + nextInfo.m_explain + "[-]"); } } } }
public void UpStar() { if (MyHead.togUpStar.value) { MyHead.UpStar.SetActive(true); MyHead.UpLevel.SetActive(false); MyHead.BtnUpStar.gameObject.SetActive(true); MyHead.btnUp.gameObject.SetActive(false); MyHead.LblNextName.text = NGUIUtil.GetStringByKey(70000115); //MyHead.BtnUpStar.isEnabled = false; if (m_CurItem != null) { m_CurItem.ResetUI(); MyHead.LblStarName.text = "[71fff0]" + m_CurItem.Godskill.m_name + "[-]"; MyHead.lblName.text = ""; MyHead.lblExplain.text = string.Format("[552d0a]" + m_CurItem.Godskill.m_stardescription + "[-]"); int bookcount = ItemDC.GetItemCount(m_CurItem.Godskill.m_needbook); if (m_CurItem.Godskill.m_needbooknum == 0 && m_CurItem.m_caption.m_star == 5) { MyHead.lblScrollNum.text = NGUIUtil.GetStringByKey(10000085); MyHead.SprProgress.fillAmount = 1.0f; } else { MyHead.lblScrollNum.text = bookcount + "/" + m_CurItem.Godskill.m_needbooknum; MyHead.SprProgress.fillAmount = bookcount * 1.0f / m_CurItem.Godskill.m_needbooknum; } GodSkillInfo nextInfo = new GodSkillInfo(); GodSkillM.GetGodSkill(m_CurItem.Godskill.m_type, m_CurItem.Godskill.m_level, m_CurItem.m_caption.m_star + 1, ref nextInfo); if (m_CurItem.m_caption.m_star == 5) { MyHead.NextStarDes.text = string.Format("[552d0a]" + NGUIUtil.GetStringByKey(10000085) + "[-]"); } else if (nextInfo != null && nextInfo.m_stardescription != null) { MyHead.NextStarDes.text = string.Format("[552d0a]" + nextInfo.m_stardescription + "[-]"); } SetTrapStarLevel(m_CurItem.m_caption.m_star); m_CurItem.CheckUp(); // MyHead.BtnUpStar.isEnabled = m_CurItem.CheckStarTop(); UIGrid grid = MyHead.StarParent.GetComponent <UIGrid>(); grid.repositionNow = true; } } }
/// <summary> /// 创建黑科技 /// </summary> void CreateBlackScience(CaptionInfo info) { if (info == null) { NGUIUtil.DebugLog("CreateBlackScience info == null"); return; } GodSkillInfo gInfo = new GodSkillInfo(); //黑科技抽取是1级,王振鑫确认 GodSkillM.GetGodSkill(info.m_godskilltype1, 1, ref gInfo); NGUIUtil.SetLableText(MyHead.LblBlackScienceDesc, gInfo.m_explain); string icon = "Textures/role/" + info.m_captionid; NGUIUtil.Set2DSprite(MyHead.Spr2dBSIcon, icon); int star = GodSkillM.GetCaptionMinStarLevel(info.m_godskilltype1); SetStarsLevel(star); }
public void SetCaption(CaptainInfo info) { m_id = info.id > 0 ? info.id : m_id; m_star = info.star > 0? info.star : m_star; m_level1 = info.level1 > 0? info.level1 : m_level1; m_godskilltype1 = info.godskilltype1 > 0? info.godskilltype1 : m_godskilltype1; GodSkillInfo skill = new GodSkillInfo(); if (m_godskilltype1 > 0 && m_level1 > 0) { GodSkillM.GetGodSkill(m_godskilltype1, m_level1, m_star, ref skill); m_GodSkill[m_godskilltype1] = skill; } skill = new GodSkillInfo(); if (info.godskilltype2 > 0 && info.level2 > 0) { m_level2 = info.level2; m_godskilltype2 = info.godskilltype2; GodSkillM.GetGodSkill(info.godskilltype2, info.level2, info.star, ref skill); m_GodSkill[info.godskilltype2] = skill; } skill = new GodSkillInfo(); if (info.godskilltype3 > 0 && info.level3 > 0) { m_level3 = info.level3; m_godskilltype3 = info.godskilltype3; GodSkillM.GetGodSkill(info.godskilltype3, info.level3, info.star, ref skill); m_GodSkill[info.godskilltype3] = skill; } skill = new GodSkillInfo(); if (info.godskilltype4 > 0 && info.level4 > 0) { m_level4 = info.level4; m_godskilltype4 = info.godskilltype4; GodSkillM.GetGodSkill(info.godskilltype4, info.level4, info.star, ref skill); m_GodSkill[info.godskilltype4] = skill; } }
/// <summary> /// 显示首次获得黑科技表现 /// </summary> private void ShowTrophiesAction() { if (CurSummonCaptianID == 0) { return; } CaptionInfo cInfo = new CaptionInfo(); GodSkillM.GetCaption(CurSummonCaptianID, ref cInfo); GodSkillInfo gInfo = new GodSkillInfo(); //黑科技抽取是1级,王振鑫确认 GodSkillM.GetGodSkill(cInfo.m_godskilltype1, 1, ref gInfo); string name = ""; name = gInfo.m_name; sdata.s_itemtypeInfo itypeInfo = new sdata.s_itemtypeInfo(); itypeInfo.gid = CurSummonCaptianID; itypeInfo.name = name; itypeInfo.gtype = 3; List <sdata.s_itemtypeInfo> lInfo = new List <sdata.s_itemtypeInfo>(); lInfo.Add(itypeInfo); TrophiesActionWnd TropWnd = WndManager.GetDialog <TrophiesActionWnd>(); if (TropWnd) { TropWnd.ClearTropiesData(); TropWnd.AddTropiesData(lInfo); TropWnd.SetWndType(3); TropWnd.MyHead.LblDes.gameObject.SetActive(false); } }
public void SetCaption(int level) { GodSkillInfo skill = new GodSkillInfo(); m_level1 = level; m_level2 = level; m_level3 = level; m_level4 = level; if (m_godskilltype1 > 0) { if (m_star == 0) { m_star = 1; } GodSkillM.GetGodSkill(m_godskilltype1, level, m_star, ref skill); if (m_GodSkill.ContainsKey(m_godskilltype1)) { m_GodSkill[m_godskilltype1] = skill; } else { m_GodSkill.Add(m_godskilltype1, skill); } } skill = new GodSkillInfo(); if (m_godskilltype2 > 0) { GodSkillM.GetGodSkill(m_godskilltype2, level, m_star, ref skill); if (m_GodSkill.ContainsKey(m_godskilltype2)) { m_GodSkill[m_godskilltype2] = skill; } else { m_GodSkill.Add(m_godskilltype2, skill); } } skill = new GodSkillInfo(); if (m_godskilltype3 > 0) { GodSkillM.GetGodSkill(m_godskilltype3, level, m_star, ref skill); if (m_GodSkill.ContainsKey(m_godskilltype3)) { m_GodSkill[m_godskilltype3] = skill; } else { m_GodSkill.Add(m_godskilltype3, skill); } } skill = new GodSkillInfo(); if (m_godskilltype4 > 0) { GodSkillM.GetGodSkill(m_godskilltype4, level, m_star, ref skill); if (m_GodSkill.ContainsKey(m_godskilltype4)) { m_GodSkill[m_godskilltype4] = skill; } else { m_GodSkill.Add(m_godskilltype4, skill); } } }
// isSoul是为了兼容闪亮登场界面的信息。 public static ItemIconInfo GetIconInfo(IconType iconType, int id, bool isSoul, bool isBook) { ItemIconInfo iconInfo = new ItemIconInfo(); if (iconType == IconType.IconType_Fragment) { if (isSoul) { int soldierTypeId = SoldierM.GetSoldierStarID(id); s_soldier_typeInfo info = SoldierM.GetSoldierType(soldierTypeId); if (info == null) { NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!"); return(null); } else { iconType = IconType.IconType_Soldier; id = info.modeltype; } } else if (isBook) { iconType = IconType.IconType_Captain; int godSkillType = GodSkillM.GetGodSkillType(id); id = GodSkillM.GetCaptainID(godSkillType); } } if (iconType == IconType.IconType_Soldier) //英雄整卡 { s_soldier_typeInfo info = SoldierM.GetSoldierType(id); if (info == null) { NGUIUtil.DebugLog("s_soldiertype id = " + id + " 静态表数据未配置!"); return(null); } else { iconInfo.mType = iconType; iconInfo.mName = info.name; iconInfo.mID = info.modeltype; } } else if (iconType == IconType.IconType_Fragment) //道具/碎片 { s_itemtypeInfo info = ItemM.GetItemInfo(id); if (info == null) { NGUIUtil.DebugLog("s_itemtype id = " + id + " 静态表数据未配置!"); return(null); } else { iconInfo.mType = iconType; iconInfo.mName = info.name; int soldierTypeId = SoldierM.GetSoldierStarID(id); iconInfo.mID = info.gid; } } else if (iconType == IconType.IconType_Bulding) //陷阱 { s_building_typeInfo buildinfo = buildingM.GetBuildType(id); iconInfo.mType = iconType; iconInfo.mName = buildinfo.name; iconInfo.mID = buildinfo.modeltype; } else if (iconType == IconType.IconType_Captain) //黑科技 { iconInfo.mType = iconType; CaptionInfo captionInfo = new CaptionInfo(); GodSkillM.GetCaption(id, ref captionInfo); GodSkillInfo godSkillInfo = new GodSkillInfo(); GodSkillM.GetGodSkill(captionInfo.m_godskilltype1, 1, ref godSkillInfo); iconInfo.mName = godSkillInfo.m_name; iconInfo.mID = id; } iconInfo.mIsSoul = isSoul; iconInfo.mIsBook = isBook; return(iconInfo); }
private string GetName(s_signinInfo info) { string result = ""; int id = info.item_type; SignInRewardType type = (SignInRewardType)info.reward_type; switch (type) { case SignInRewardType.BlackScience: CaptionInfo cInfo = new CaptionInfo(); GodSkillM.GetCaption(id, ref cInfo); GodSkillInfo gInfo = new GodSkillInfo(); GodSkillM.GetGodSkill(cInfo.m_godskilltype1, 1, ref gInfo); result = gInfo.m_name; break; case SignInRewardType.HeroSoulFragment: case SignInRewardType.ItemAndEquip: case SignInRewardType.TrapFragment: case SignInRewardType.BlackScienceFragment: s_itemtypeInfo info1 = ItemM.GetItemInfo(id); if (info1 != null) { result = info1.name; } break; case SignInRewardType.Hero: SoldierInfo info2 = SoldierM.GetSoldierInfo(id); if (info2 != null) { result = info2.m_name; } break; case SignInRewardType.Trap: BuildInfo info3 = buildingM.GetStartBuildInfo(id); if (info3 != null) { result = info3.m_name; } break; case SignInRewardType.GoldCoin: result = NGUIUtil.GetStringByKey(88800061); break; case SignInRewardType.Diamond: result = NGUIUtil.GetStringByKey(99700001); break; case SignInRewardType.Crystal: result = NGUIUtil.GetStringByKey(10000177); break; case SignInRewardType.Wood: result = NGUIUtil.GetStringByKey(10000178); break; } return(result); }