public void OnClickMySelf() { if (id == 2) { if (mTipsText == null) { mTips.SetActive(false); UI_StageInfo._instance.Tips.SetActive(false); } else { mTips.SetActive(true); UI_StageInfo._instance.Tips.SetActive(true); UI_StageInfo._instance.TipsDes.text = GameUtils.getString(mTipsText); } } else { switch (typeNum) { //符文 case 1: ItemTemplate rune = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(id); UI_RuneInfo.SetShowRuneDate(rune); UI_HomeControler.Inst.AddUI("UI_Rune/UI_RuneInfo_1_3"); break; //道具 case 2: ItemTemplate item = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(id); UI_Item.SetItemTemplate(item); UI_HomeControler.Inst.AddUI("UI_Home/UI_Item_1_3"); break; //英雄 case 3: UI_HomeControler.Inst.AddUI("UI_Home/UI_HeroInfoPop_1_3"); ObjectCard obj = new ObjectCard(); Hero hero = new Hero(); HeroTemplate _hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(id); hero.skill1 = _hero.getSkill1ID(); hero.skill2 = _hero.getSkill2ID(); hero.skill3 = _hero.getSkill3ID(); hero.heroid = id; hero.herolevel = 1; hero.heroviewid = _hero.getArtresources(); obj.GetHeroData().Init(hero); //Destroy(UI_SelectFightArea.Inst.Card3Dmodel); HeroInfoPop.inst.Show3DModel(obj); HeroInfoPop.inst.ShowInfo(obj); break; default: break; } } }
/// <summary> /// 根据id展示不同的物品展示界面; /// </summary> /// <param name="tableID"></param> public static bool ShowItemPreviewUIHandler(int tableID) { EM_OBJECT_CLASS eoc = GameUtils.GetObjectClassById(tableID); switch (eoc) { case EM_OBJECT_CLASS.EM_OBJECT_CLASS_RUNE: ItemTemplate runeItemT = DataTemplate.GetInstance().GetItemTemplateById(tableID); if (runeItemT == null) { LogManager.LogError("item表格中缺少物品id=" + tableID); return(false); } UI_RuneInfo.SetShowRuneDate(runeItemT); UI_HomeControler.Inst.AddUI(UI_RuneInfo.UI_ResPath); return(true); case EM_OBJECT_CLASS.EM_OBJECT_CLASS_COMMON: ItemTemplate itemT = DataTemplate.GetInstance().GetItemTemplateById(tableID); if (itemT == null) { LogManager.LogError("item表格中缺少物品id=" + tableID); return(false); } UI_Item.SetItemTemplate(itemT); UI_HomeControler.Inst.AddUI(UI_Item.UI_ResPath); return(true); case EM_OBJECT_CLASS.EM_OBJECT_CLASS_SKIN: ArtresourceTemplate artT = DataTemplate.GetInstance().GetArtResourceTemplate(tableID); if (artT == null) { LogManager.LogError("ArtResource时装表格中缺少物品id=" + tableID); return(false); } UI_SkinPreviewMgr.SetShowArtTemplate(artT); UI_HomeControler.Inst.AddUI(UI_SkinPreviewMgr.UI_ResPath); return(true); case EM_OBJECT_CLASS.EM_OBJECT_CLASS_HERO: HeroTemplate heroT = DataTemplate.GetInstance().GetHeroTemplateById(tableID); if (heroT == null) { LogManager.LogError("hero表格中缺少物品id=" + tableID); return(false); } UI_HomeControler.Inst.AddUI(HeroInfoPop.UI_ResPath); HeroInfoPop.inst.SetShowData(heroT); return(true); case EM_OBJECT_CLASS.EM_OBJECT_CLASS_RES: //资源类型点击无响应; return(true); default: LogManager.LogError("未处理的商城物品预览类型"); return(false); } }
public void OnClickSelf() { switch (typeNum) { //符文 case 1: ItemTemplate rune = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(id); UI_RuneInfo.SetShowRuneDate(rune); if (UI_HomeControler.Inst == null) { UI_FightControler.Inst.AddUI("UI_Rune/UI_RuneInfo_1_3"); } else { UI_HomeControler.Inst.AddUI("UI_Rune/UI_RuneInfo_1_3"); } break; //道具 case 2: ItemTemplate item = (ItemTemplate)DataTemplate.GetInstance().m_ItemTable.getTableData(id); UI_Item.SetItemTemplate(item); if (UI_HomeControler.Inst == null) { UI_FightControler.Inst.AddUI("UI_Home/UI_Item_1_3"); } else { UI_HomeControler.Inst.AddUI("UI_Home/UI_Item_1_3"); } break; //英雄 case 3: if (UI_HomeControler.Inst == null) { UI_FightControler.Inst.AddUI("UI_Home/UI_HeroInfoPop_1_3"); } else { UI_HomeControler.Inst.AddUI("UI_Home/UI_HeroInfoPop_1_3"); } //ObjectCard obj = new ObjectCard(); //Hero hero = new Hero(); HeroTemplate _hero = (HeroTemplate)DataTemplate.GetInstance().m_HeroTable.getTableData(id); //hero.skill1 = _hero.getSkill1ID(); //hero.skill2 = _hero.getSkill2ID(); //hero.skill3 = _hero.getSkill3ID(); //hero.heroid = id; //hero.herolevel = 1; //hero.heroviewid = _hero.getArtresources(); //obj.GetHeroData().Init(hero); //Destroy(UI_SelectFightArea.Inst.Card3Dmodel); HeroInfoPop.inst.SetShowData(_hero); break; default: break; } }