void Awake() { m2 = transform.FindChild("2").GetComponent <Image>(); m1 = transform.FindChild("1").GetComponent <Image>(); m1.gameObject.SetActive(false); m2.gameObject.SetActive(false); //m2.gameObject.SetActive(false); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7011")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7012")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7013")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7014")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7015")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7016")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7017")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7018")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7019")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7020")); }
//初始化技能信息 private void InitSkillInfo() { int Skill1id = CurCard.GetHeroData().SpellDataList[0].SpellID; Gskilltemp = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(Skill1id); Sprite _img1 = UIResourceMgr.LoadSprite(common.defaultPath + Gskilltemp.getSkillIcon()); Skill1Image.sprite = _img1; Skill1Lv.text = Gskilltemp.getSkillLevel().ToString(); int Skill2id = CurCard.GetHeroData().SpellDataList[1].SpellID; Pskilltemp = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(Skill2id); Sprite _img2 = UIResourceMgr.LoadSprite(common.defaultPath + Pskilltemp.getSkillIcon()); Skill2Image.sprite = _img2; Skill2Lv.text = Pskilltemp.getSkillLevel().ToString(); //int Skill3id = CurCard.GetHeroData().SpellDataList[2].SpellID; //Askilltemp = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.m_Data[Skill3id]; //Sprite _img3 = UIResourceMgr.LoadSprite(common.defaultPath + Askilltemp.getSkillIcon()); //Skill3Image.sprite = _img3; //Skill3Lv.text = Askilltemp.getSkillLevel().ToString(); //判断技能是否开启 if (!InterfaceControler.GetInst().IsOpenSkill(CurCard.GetHeroRow(), Gskilltemp.getSkillNo())) { GameUtils.SetImageGrayState(Skill1Image, true); } else { GameUtils.SetImageGrayState(Skill1Image, false); } if (!InterfaceControler.GetInst().IsOpenSkill(CurCard.GetHeroRow(), Pskilltemp.getSkillNo())) { GameUtils.SetImageGrayState(Skill2Image, true); } else { GameUtils.SetImageGrayState(Skill2Image, false); } }
//显示战斗掉落物品 public void InitFightAreaGoodItem(string name, int num) { GoodImage = selfTransform.FindChild("Good_Image").GetComponent <Image>(); Bg_Image = selfTransform.FindChild("BG_Image").gameObject; Num = selfTransform.FindChild("BG_Image/Num").GetComponent <Text>(); Rand_Image = selfTransform.FindChild("Rand_Image").gameObject; Sprite _img = UIResourceMgr.LoadSprite(common.defaultPath + name); GoodImage.sprite = _img; if (num > 0) { Rand_Image.SetActive(false); Bg_Image.SetActive(true); Num.text = "x" + num.ToString(); } else { Rand_Image.SetActive(true); Bg_Image.SetActive(false); } }
//显示所在队伍图片 private void SetFormationNum() { ClearFormNum(); List <int> NumList = new List <int>(); for (int k = 0; k < GlobalMembers.MAX_MATRIX_COUNT; ++k) { for (int j = 0; j < GlobalMembers.MAX_TEAM_CELL_COUNT; ++j) { ObjectCard temp = ObjectSelf.GetInstance().HeroContainerBag.FindHero(ObjectSelf.GetInstance().Teams.m_Matrix[k, j]); if (temp == null) { continue; } if (HeroObject.GetHeroData().GUID == temp.GetHeroData().GUID) { NumList.Add(k + 1); } } } int count = NumList.Count; for (int i = 0; i < count - 1; i++) { for (int p = 0; p < count - 1 - i; p++) { if (NumList[p] > NumList[p + 1]) { int a = NumList[p]; NumList[p] = NumList[p + 1]; NumList[p + 1] = a; } } } for (int o = 0; o < count; ++o) { FormationImageList[o].enabled = true; FormationImageList[o].sprite = UIResourceMgr.LoadSprite("UI/Number/formation_num/" + NumList[o].ToString());//图片 } }
//初始化战斗结束卡牌 public void InitFightEnd(ObjectCard heroObject) { HeroObject = heroObject; _Herodata = heroObject.GetHeroRow(); Parent = selfTransform.FindChild("Parent"); int _ArtresourcedataID = HeroObject.GetHeroData().GetHeroViewID(); CardImage = Parent.FindChild("Icon_Img").GetComponent <Image>(); CardNameText = Parent.FindChild("Name_txt").GetComponent <Text>(); _CardLevelText = Parent.FindChild("Level_txt"); HeroEx = Parent.FindChild("HeroExbar").GetComponent <Slider>(); //HeroEx.value = heroObject.GetHeroData().Exp; CardName = GameUtils.getString(_Herodata.getTitleID()); CardNameText.text = CardName;//名称 CardLevel = heroObject.GetHeroData().Level; InterfaceControler.GetInst().AddLevelNum(CardLevel.ToString(), _CardLevelText, url); _Artresourcedata = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(HeroObject.GetHeroData().GetHeroViewID()); CardImage.sprite = UIResourceMgr.LoadSprite(common.defaultPath + _Artresourcedata.getHeadartresource()); InterfaceControler.GetInst().AddSharLevel(Parent.FindChild("Star_Image"), _Herodata); //SetBaseInfo(heroObject.GetHeroData().Level); }
Sprite GetImage(int value) { switch (value) { case 0: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7001")); case 1: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7002")); case 2: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7003")); case 3: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7004")); case 4: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7005")); case 5: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7006")); case 6: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7007")); case 7: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7008")); case 8: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7009")); case 9: return(UIResourceMgr.LoadSprite("UI/Number/battle_number/img_7010")); default: return(null); } }
public RoundNumber init(int type) { this.type = type; switch (type) { case 0: { mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_00")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_01")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_02")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_03")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_04")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_05")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_06")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_07")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_08")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_09")); } break; case 1: { mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_0")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_1")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_2")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_3")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_4")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_5")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_6")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_7")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_8")); mNums.Add(UIResourceMgr.LoadSprite("UI/Number/round_number/Battle_9")); } break; } return(this); }
public void SetGoodsItem(int iStageId) { for (int i = 0; i < objList.Count; i++) { Destroy(objList[i]); } objList.Clear(); int count = mGoodsItemGroup.childCount; for (int i = 0; i < count; ++i) { Destroy(mGoodsItemGroup.GetChild(i).gameObject); } iStageID = iStageId; //StageTemplate stageinfo = (StageTemplate)DataTemplate.GetInstance().m_StageTable.getTableData(iStageID); StageTemplate stageinfo = StageModule.GetStageTemplateById(iStageID); ////if (list.ContainsKey(iStageId)) //{ // //StageTemplate stageinfo = (StageTemplate)list[iStageID]; // if (stageinfo != null) // { // Dictionary<string, int> temp = stageinfo.getDisplaydrop(); // foreach (var info in temp) // { // GameObject gooditem = Instantiate(Resources.Load("UI/Prefabs/UI_Fight/UI_LGoodItem")) as GameObject; // gooditem.transform.SetParent(mGoodsItemGroup, false); // gooditem.AddComponent<UI_GoodItem>().InitFightAreaGoodItem(info.Key, info.Value); // } // } //} string displaydrop = stageinfo.m_displaydrop; if (displaydrop == "-1" || string.IsNullOrEmpty(displaydrop)) { } else { string[] displaydropList = displaydrop.Split('#'); if (displaydropList.Length == 0) { return; } for (int i = 0; i < displaydropList.Length; i++) { string[] itemList = displaydropList[i].Split('-'); switch (int.Parse(itemList[0])) { case 1: int inner = int.Parse(itemList[1]); int itemid = inner / 1000000; switch (itemid) { case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: { GameObject item = Instantiate(Resources.Load("UI/Prefabs/UI_Fight/UI_LGoodRune"), transform.position, transform.rotation) as GameObject; item.transform.SetParent(mGoodsItemGroup, false); //item.transform.parent = mGoodsItemGroup; //item.transform.localScale = Vector3.one; //ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(inner); ItemTemplate itemTable = DataTemplate.GetInstance().GetItemTemplateById(inner); UI_DropFightItemManage uifigt = item.GetComponent <UI_DropFightItemManage>(); uifigt.typeNum = 1; uifigt.id = inner; uifigt.mIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + itemTable.getIcon()); uifigt.mIcon.SetNativeSize(); if (int.Parse(itemList[2]) == 0) { uifigt.mProbability.SetActive(true); uifigt.mNumObj.SetActive(false); } else { uifigt.mProbability.SetActive(false); uifigt.mNumObj.SetActive(true); uifigt.mNum.text = "x" + itemList[3]; } objList.Add(item); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: { GameObject item = Instantiate(Resources.Load("UI/Prefabs/UI_Fight/UI_LGoodItem"), transform.position, transform.rotation) as GameObject; item.transform.SetParent(mGoodsItemGroup, false); //item.transform.parent = mGoodsItemGroup; //item.transform.localScale = Vector3.one; //ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(inner); ItemTemplate itemTable = DataTemplate.GetInstance().GetItemTemplateById(inner); UI_DropFightItemManage uifigt = item.GetComponent <UI_DropFightItemManage>(); uifigt.id = inner; uifigt.typeNum = 2; uifigt.mIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + itemTable.getIcon()); uifigt.mIcon.SetNativeSize(); if (int.Parse(itemList[2]) == 0) { uifigt.mProbability.SetActive(true); uifigt.mNumObj.SetActive(false); } else { uifigt.mProbability.SetActive(false); uifigt.mNumObj.SetActive(true); uifigt.mNum.text = "x" + itemList[3]; } objList.Add(item); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: { GameObject item = Instantiate(Resources.Load("UI/Prefabs/UI_Fight/UI_LGoodHero"), transform.position, transform.rotation) as GameObject; item.transform.SetParent(mGoodsItemGroup, false); //item.transform.parent = mGoodsItemGroup; //item.transform.localScale = Vector3.one; //HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(inner); HeroTemplate hero = DataTemplate.GetInstance().GetHeroTemplateById(inner); UI_DropFightItemManage uihero = item.GetComponent <UI_DropFightItemManage>(); uihero.id = inner; uihero.typeNum = 3; //ArtresourceTemplate art = (ArtresourceTemplate)DataTemplate.GetInstance().m_ArtresourceTable.getTableData(hero.getArtresources()); ArtresourceTemplate art = DataTemplate.GetInstance().GetArtResourceTemplate(hero.getArtresources()); uihero.mIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + art.getHeadiconresource()); uihero.mIcon.SetNativeSize(); int star = hero.getQuality(); int maxStar = hero.getMaxQuality(); for (int j = 0; j < 5; j++) { uihero.starList[j].SetActive(j < star); uihero.starList[j + 5].SetActive(j < maxStar); } //for (int j = 0; j < star; j++) //{ // uihero.starList[j].SetActive(true); //} //for (int k = star; k < 5; k++) //{ // uihero.starList[k].SetActive(false); //} if (int.Parse(itemList[2]) == 0) { uihero.mProbability.SetActive(true); } else { uihero.mProbability.SetActive(false); } objList.Add(item); } break; default: break; } break; case 2: GameObject items = Instantiate(Resources.Load("UI/Prefabs/UI_Fight/UI_LGoodItem"), transform.position, transform.rotation) as GameObject; items.transform.SetParent(mGoodsItemGroup, false); //items.transform.parent = mGoodsItemGroup; //items.transform.localScale = Vector3.one; UI_DropFightItemManage uiitems = items.GetComponent <UI_DropFightItemManage>(); uiitems.id = 2; uiitems.mIcon.sprite = UIResourceMgr.LoadSprite(common.defaultPath + itemList[1]); uiitems.mIcon.SetNativeSize(); if (int.Parse(itemList[2]) == 0) { uiitems.mProbability.SetActive(true); uiitems.mNumObj.SetActive(false); } else { uiitems.mProbability.SetActive(false); uiitems.mNumObj.SetActive(true); uiitems.mNum.text = "x" + itemList[3]; } if (itemList[3] == "0") { uiitems.mTipsText = null; } else { uiitems.mTipsText = itemList[3]; } objList.Add(items); break; default: break; } } } }
public override void InitUIData() { Inst = this; m_Mask = selfTransform.FindChild("Mask").gameObject; m_LimitFightUIObj = selfTransform.FindChild("UI_LimitFight").gameObject; m_bg = selfTransform.FindChild("Image(bottombg)"); m_TopRight = selfTransform.FindChild("topright"); m_Bottom = selfTransform.FindChild("bottom"); // 按钮 speedBtn = selfTransform.FindChild("Button(speed)").GetComponent <Button>(); speedBtn.onClick.AddListener(onSpeedCall); m_PauseBtn = selfTransform.FindChild("Button(pause)").GetComponent <Button>(); m_PauseBtn.onClick.AddListener(onPauseCall); m_EscBtn = selfTransform.FindChild("EscBtn").GetComponent <Button>(); m_EscBtn.onClick.AddListener(OnClickEscButton); autoBtn = selfTransform.FindChild("Button(autoFight)").GetComponent <Button>(); autoBtn.onClick.AddListener(OnClickSkillIcon); // 技能页 mSkillPanel = selfTransform.FindChild("bottom/SkillPanel").GetComponent <UI_SkillPanel>(); m_Speed = speedBtn.transform.FindChild("Text").GetComponent <Text>(); m_Auto_Effect = autoBtn.transform.FindChild("effect/auto"); m_Auto_Button = autoBtn.transform.FindChild("Image(auto)"); m_Hand_Effect = autoBtn.transform.FindChild("effect/shoudong"); m_Hand_Button = autoBtn.transform.FindChild("Image(shoudong)"); // 战场信息 Transform infoTrans = selfTransform.FindChild("TopPanel"); //timeTransfrom = infoTrans.FindChild("time"); //mHundred = infoTrans.FindChild("time/3").GetComponent<Image>(); //mTow = infoTrans.FindChild("time/2").GetComponent<Image>(); //mOne = infoTrans.FindChild("time/1").GetComponent<Image>(); m_TimeLimit = transform.FindChild("topright/Text(timelimit)").GetComponent <Text>(); m_TimeTransform = transform.FindChild("topright/Text(timelimit)"); mLevelName = infoTrans.FindChild("LevelName").GetComponent <Text>(); //mInfiniteTime = infoTrans.FindChild("Infinite").gameObject; mStageName = transform.FindChild("topright/levelname").GetComponent <Text>(); mSPControl = selfTransform.FindChild("SP").GetComponent <UI_SPControl>(); //mCurRound = selfTransform.FindChild("RoundTag/curRound").gameObject.AddComponent<RoundNumber>().init(1); //mTotalRound = selfTransform.FindChild("RoundTag/totalRound").gameObject.AddComponent<RoundNumber>().init(0); m_TotalRound[0] = transform.FindChild("topright/wave_1"); m_TotalRound[1] = transform.FindChild("topright/wave_2"); m_TotalRound[2] = transform.FindChild("topright/wave_3"); m_CurRound[0] = transform.FindChild("topright/process/1"); m_CurRound[1] = transform.FindChild("topright/process/2"); m_CurRound[2] = transform.FindChild("topright/process/3"); m_AngerImager = transform.FindChild("bottom/nuqivalue").GetComponent <Image>(); m_AngerImager.gameObject.SetActive(false); // buff mSelfBuff = infoTrans.FindChild("SelfBuffer").gameObject.AddComponent <UI_BuffAllControl>(); mEnemyBuff = infoTrans.FindChild("EnemyBuffer").gameObject.AddComponent <UI_BuffAllControl>(); // 怒气 mSelfAnger = transform.FindChild("bottom/nuqi").gameObject.AddComponent <AngerNumber>(); //mEnemyAnger = infoTrans.FindChild("right/value").gameObject.AddComponent<AngerNumber>(); //技能图标 m_Skill1 = transform.FindChild("bottom/SkillPanel/skill_1"); m_Skill2 = transform.FindChild("bottom/SkillPanel/skill_2"); m_Skill3 = transform.FindChild("bottom/SkillPanel/skill_3"); m_Skill4 = transform.FindChild("bottom/SkillPanel/skill_4"); m_Skill5 = transform.FindChild("bottom/SkillPanel/skill_5"); m_Skill1.gameObject.SetActive(false); m_Skill2.gameObject.SetActive(false); m_Skill3.gameObject.SetActive(false); m_Skill4.gameObject.SetActive(false); m_Skill5.gameObject.SetActive(false); m_SkillArys[0] = m_Skill1; m_SkillArys[1] = m_Skill2; m_SkillArys[2] = m_Skill3; m_SkillArys[3] = m_Skill4; m_SkillArys[4] = m_Skill5; // 战场倒计时图片资源 mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/0")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/1")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/2")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/3")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/4")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/5")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/6")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/7")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/8")); mNumberSprite.Add(UIResourceMgr.LoadSprite("UI/Number/fight_time/9")); // SetInitObjectIsShow(false); //是否极限试炼 if (ObjectSelf.GetInstance().LimitFightMgr.m_bStartEnter) { m_LimitFightUIObj.SetActive(true); SetStageNameActive(false); } if (int.Parse(ConfigsManager.Inst.GetClientConfig(ClientConfigs.BattleMode)) == 0)//自动 yao 15-6-29 { isAuto = true; } else { isAuto = false;//手动模式 } //isAuto = false; // 添加更新事件 GameEventDispatcher.Inst.addEventListener(GameEventID.F_Anger_Update, onAngerUpdate); GameEventDispatcher.Inst.addEventListener(GameEventID.SE_PrepareEnemy, onRoundUpdateCall); GameEventDispatcher.Inst.addEventListener(GameEventID.F_LimitBoutEnd, ShowLimitFightRoundNum); GameEventDispatcher.Inst.addEventListener(GameEventID.G_Guide_Stop_Type, StopNextGuide); GameEventDispatcher.Inst.addEventListener(GameEventID.G_Guide_Fighting, GuideFinghting); GameEventDispatcher.Inst.addEventListener(GameEventID.G_Guide_Continue, GuideContinue); ////////////////////////////////////////////////////////////////////////// if (GuideManager.GetInstance().IsContentGuideID(100306) == false) { //m_IsGuide = true; } else { m_IsGuide = false; } }
/// <summary> /// 设置左侧按钮图片为整体不分割 并且字体居中 /// </summary> public void SetLeftYesMid() { Left_Btn_Img.sprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_xuanze"); LeftBtn_text.gameObject.SetActive(false); LeftBtn_Midtext.gameObject.SetActive(true); }
/// <summary> /// 进阶后的属性显示 /// </summary> public void NewShow() { HeroTemplate _hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(_Card.GetHeroRow().getStageUpTargetID()); int level = 0; switch (_hero.getQuality()) { case 2: mSkill.SetActive(false); break; case 3: mSkill.SetActive(true); int skillID3 = _hero.getSkill2ID(); SkillTemplate skill3 = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(skillID3); mSkillBg.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + skill3.getSkillIcon()); mSkillLevel.text = skill3.getSkillLevel().ToString(); mSkillName.text = GameUtils.getString(skill3.getSkillName()); mSkillType.text = GameUtils.getString("common_skilltypename_1"); UI_SkillTips _tips3 = new UI_SkillTips(_Card, skill3); mSkillDesText.text = _tips3.SetShow(); level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_3(); break; case 4: mSkill.SetActive(true); int skillID4 = _hero.getSkill3ID(); if (skillID4 != -1) { SkillTemplate skill4 = (SkillTemplate)DataTemplate.GetInstance().m_SkillTable.getTableData(skillID4); mSkillBg.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + skill4.getSkillIcon()); mSkillLevel.text = skill4.getSkillLevel().ToString(); mSkillName.text = GameUtils.getString(skill4.getSkillName()); mSkillType.text = GameUtils.getString("common_skilltypename_3"); UI_SkillTips _tips4 = new UI_SkillTips(_Card, skill4); mSkillDesText.text = _tips4.SetShow(); } else { mSkill.SetActive(false); } level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_4(); break; case 5: level = DataTemplate.GetInstance().m_GameConfig.getHero_advanced_level_5(); mSkill.SetActive(false); break; default: break; } Hero hero = new Hero(); hero.heroid = _Card.GetHeroRow().getStageUpTargetID(); hero.herolevel = level; hero.heroviewid = _hero.getArtresources(); // ObjectCard obj = new ObjectCard(); obj.GetHeroData().Init(hero); HeroData _heroDate = obj.GetHeroData(); mLevelNew.text = obj.GetHeroData().Level + "/" + _hero.getMaxLevel(); mHpNew.text = (obj.GetBaseMaxHP() - _heroDate.TrainingMaxHP).ToString(); int nPhysicalTraniningValue = 0; if (_hero.getClientSignType()[1] == 0) { nPhysicalTraniningValue = _heroDate.TrainingPhysicalAttack; } mPhysicsAttacksNew.text = (obj.GetPhysicalBaseAttack() - nPhysicalTraniningValue).ToString(); int nMagicTraniningValue = 0; if (_hero.getClientSignType()[1] == 1) { nMagicTraniningValue = _heroDate.TrainingMagicAttack; } mMagicAttacksNew.text = (obj.GetMagicBaseAttack() - nMagicTraniningValue).ToString(); mPhysicsDefenseNew.text = (obj.GetPhysicalBaseDefence() - _heroDate.TrainingPhysicalDefence).ToString(); mMagicDefenseNew.text = (obj.GetMagicBaseDefence() - _heroDate.TrainingMagicDefence).ToString(); mAccuracyNew.text = obj.GetBaseHit().ToString(); mEvaNew.text = obj.GetBaseDodge().ToString(); mCritNew.text = obj.GetBaseCritical().ToString(); mTenacityNew.text = obj.GetBaseTenacity().ToString(); mVelocityNew.text = obj.GetBaseSpeed().ToString(); int m_HeroStar = _hero.getQuality(); int maxStar = _hero.getMaxQuality(); //星级品质界面控制 for (int i = 0; i < 5; i++) { mStarListNew[i].SetActive(i + 1 <= m_HeroStar); mStarBGListNew[i].SetActive(i + 1 <= maxStar); } //for (int i = 0; i < mStarListNew.Count; i++) //{ // if (i < _hero.getQuality()) // { // mStarListNew[i].SetActive(true); // } // else // { // mStarListNew[i].SetActive(false); // } //} mSkillMaxNew.text = _hero.getSkillMaxLevel().ToString(); Show3DModel(obj); }
/// <summary> /// 进阶需求显示 /// </summary> public void NeedShow() { HeroTemplate _hero = _Card.GetHeroRow(); int stageUpCostType1 = _hero.getStageUpCostType1(); if (stageUpCostType1 == 1400000002)//金币 { mNeedMoneytype.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Home_03"); mNeedMoney.text = _hero.getStageUpCost1().ToString(); if (ObjectSelf.GetInstance().Money < _hero.getStageUpCost1()) { mNeedMoney.color = Color.red; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_25"); } else { mNeedMoney.color = Color.white; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_03"); } } else if (stageUpCostType1 == 1400000001)//魔钻 { mNeedMoneytype.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Home_02"); mNeedMoney.text = _hero.getStageUpCost1().ToString(); if (ObjectSelf.GetInstance().Gold < _hero.getStageUpCost1()) { mNeedMoney.color = Color.red; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_25"); } else { mNeedMoney.color = Color.white; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_03"); } } int stageUpCostType2 = _hero.getStageUpCostType2(); if (stageUpCostType2 == 1402010005)//贤者之石紫 { mNeedZiyuanType.gameObject.SetActive(true); mNeedZiyuanType.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_jinjie_01"); mNeedZiyuan.text = _hero.getStageUpCost2().ToString(); if (mZiyuan1Num < _hero.getStageUpCost2()) { mNeedZiyuan.color = Color.red; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_25"); } else { mNeedZiyuan.color = Color.white; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_03"); } } else if (stageUpCostType2 == 1402010006)//贤者之石黄 { mNeedZiyuanType.gameObject.SetActive(true); mNeedZiyuanType.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_jinjie_02"); mNeedZiyuan.text = _hero.getStageUpCost2().ToString(); if (mZiyuan2Num < _hero.getStageUpCost2()) { mNeedZiyuan.color = Color.red; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_25"); } else { mNeedZiyuan.color = Color.white; beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_03"); } } else { mNeedZiyuanType.gameObject.SetActive(false); } if (_Card.GetHeroData().Level < _Card.GetHeroRow().getMaxLevel()) { beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_25"); } else { beginnerButton.transform.GetComponent <Image>().overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "UI_Tong_03"); } }
public override void InitUIData() { base.InitUIData(); num_flag1 = UIResourceMgr.LoadSprite(common.defaultPath + "Battle_Miss"); }
//public bool isReward(int difficulttype, int rewardnum) //{ // int reward = 0; // if (difficulttype == 1) // { // reward = rewardnum % 10; // } // else if (difficulttype == 2) // { // reward = rewardnum % 100 / 10; // } // else if (difficulttype == 3) // { // reward = rewardnum / 100; // } // return reward != 0; //} public void UpdateShow() { //Debug.Log(mGrid.transform.position); //mGrid.transform.position = new Vector3(-225.4f, -4.7f, -263.4f); //与服务器交互显示所得物品 //UI_SelectFightArea sfight = UI_SelectFightArea.Inst; int chapterId = ObjectSelf.GetInstance().GetCurChapterID(); int difficultLv = ObjectSelf.GetInstance().CurChapterLevel; ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(chapterId); if (chapterT != null) { int total = 0; int curstart = 0; StageModule.GetCurTotalStarsCount(chapterT, (EM_STAGE_DIFFICULTTYPE)difficultLv, out curstart, out total); if (curstart >= total) { //TODO 宝箱弹窗 //if (isReward(difficultLv, sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot)) if (StageModule.isReward(difficultLv, ObjectSelf.GetInstance().BattleStageData.GetRewardGot(chapterId))) { mHeader.text = GameUtils.getString("fight_bosbox_content"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); } else { mHeader.text = GameUtils.getString("sign_content5"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "领 取"; mCloseText.text = GameUtils.getString("common_button_receive"); } } else { mHeader.text = GameUtils.getString("fight_bosbox_content"); mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); } innerdropIDList.Clear(); //int[] chapterDropList = ((ChapterinfoTemplate)DataTemplate.GetInstance().m_ChapterTable.getTableData(sfight.iChapterID)).getChapterDrop(); //int chapterDropID = chapterDropList[difficultLv - 1]; //int[] innerdropList = ((NormaldropTemplate)DataTemplate.GetInstance().m_NormaldropTable.getTableData(chapterDropID)).getInnerdrop(); //Dictionary<int, IExcelBean> innerIExcel = DataTemplate.GetInstance().m_InnerdropTable.getData(); ////List<InnerdropTemplate> innerdropIDList = new List<InnerdropTemplate>(); //for (int i = 0; i < innerdropList.Length; i++) //{ // foreach (var item in innerIExcel.Values) // { // if (((InnerdropTemplate)item).getInnerdropid() == innerdropList[i]) // { // innerdropIDList.Add((InnerdropTemplate)item); // } // } //} //ChapterinfoTemplate chapterT = StageModule.GetChapterinfoTemplateById(ObjectSelf.GetInstance().GetCurChapterID()); //if (chapterT == null) //{ // LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterId); // return; //} int dropId = difficultLv - 1; if (chapterT.getChapterDrop().Length <= 0) { LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate 中章节掉落包数组是空的. id=" + chapterId); return; } int chapterDropId = chapterT.getChapterDrop()[dropId]; NormaldropTemplate normalT = DataTemplate.GetInstance().GetNormaldropTemplateById(chapterDropId); if (normalT == null) { LogSystem.LogManager.LogToFile("战斗奖励界面失败---ChapterinfoTemplate is NULL. id=" + chapterDropId); return; } int[] innerDropList = normalT.getInnerdrop(); for (int i = 0, j = innerDropList.Length; i < j; i++) { foreach (int k in DataTemplate.GetInstance().m_InnerdropTable.GetDataKeys()) { InnerdropTemplate _it = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(k); if (_it == null) { continue; } if (_it.getInnerdropid() == innerDropList[i]) { innerdropIDList.Add(k); } } } } //char[] sfightList = sfight.iTotalCharpter[sfight.iChapterID].m_bRewardGot.ToString().ToCharArray(); else { mCloseImage.overrideSprite = UIResourceMgr.LoadSprite(common.defaultPath + "Ui_xuanze"); //mCloseText.text = "关 闭"; mCloseText.text = GameUtils.getString("common_button_close"); for (int i = 0; i < UI_SacredAltar._instance.m_FallItemList.Count; i++) { //InnerdropTemplate item = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(UI_SacredAltar._instance.m_FallItemList[i]); //InnerdropTemplate item = DataTemplate.GetInstance().GetInnerdropTemplateById(UI_SacredAltar._instance.m_FallItemList[i]); innerdropIDList.Add(UI_SacredAltar._instance.m_FallItemList[i]); } } for (int i = 0; i < innerdropIDList.Count; i++) { m_Cell = UniversalItemCell.GenerateItem(mGrid.transform); InnerdropTemplate value = (InnerdropTemplate)DataTemplate.GetInstance().m_InnerdropTable.getTableData(innerdropIDList[i]); if (value == null) { return; } int itemid = value.getObjectid();//掉落物ID int type = value.getObjectid() / 1000000; m_Cell.AddClickListener(ShowItemPreviewUIHandler); switch (type) { case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES: ResourceindexTemplate _temp_res = (ResourceindexTemplate)DataTemplate.GetInstance().m_ResourceindexTemplate.getTableData(itemid); if (_temp_res != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(_temp_res.getName()), "", ""); } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: //符文 { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, -1); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: { ItemTemplate itemTable = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(itemid); if (itemTable != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(itemTable.getName()), "", ""); } } break; case (int)EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: { HeroTemplate hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(itemid); if (hero != null) { m_Cell.InitByID(itemid, value.getDropnum()); m_Cell.SetText(GameUtils.getString(hero.getTitleID()), "", ""); } } break; default: break; } } }