void BtnItemClick_OnClickHander(UIButton sender) { if (m_counterInfo != null) { bool Open = StageDC.CheckOpenStage((StageType)m_counterInfo.type, m_counterInfo.id); if (!Open) { NGUIUtil.ShowTipWndByKey(10000175); return; } StageMapWnd wnd = WndManager.GetDialog <StageMapWnd>(); if (wnd != null) { wnd.SetMainMenuTop(false); int stageNode = StageDC.GetStageNode(m_counterInfo.id); int chapter = StageDC.GetStageChapter(m_counterInfo.id); wnd.GotoChapter((StageType)m_counterInfo.type, chapter, stageNode); ItemComeFromWnd itemComeWnd = WndManager.FindDialog <ItemComeFromWnd>(); if (itemComeWnd != null) { WndManager.SetBeforeWnd(wnd, itemComeWnd); } } } }
/// <summary> /// 点击事件 /// </summary> public override bool OnClick() { StageMapWnd wnd = WndManager.FindDialog <StageMapWnd>(); if (wnd == null) { wnd = WndManager.GetDialog <StageMapWnd>(); if (wnd != null) { wnd.GotoChapter(StageDC.GetCompaignStageType(), StageDC.GetStageChapter(StageDC.GetCompaignStageType()), -1); MainTownScene.SaveCameraPosToCamPosTemp(); } } return(true); }
/// <summary> /// 设置奖励界面数据 /// </summary> /// <param name="type">是否获取到物品</param> /// <param name="StarRewardID">s_stage_reward表的id</param> /// <param name="starNumText">星星数量,如 8/15 </param> /// <param name="itemList">奖励物品列表</param> public void SetData(StageMapWnd Wnd, StarAwardType type, int StarRewardID, int HaveStar, int TotalStar) { m_wnd = Wnd; m_type = type; m_starRewardID = StarRewardID; m_itemList = StageM.GetChapterRewardItem(m_starRewardID, ref m_RewardCoin, ref m_RewardDiamond); MyHead.LblCoin.text = m_RewardCoin.ToString(); MyHead.LblDiamond.text = m_RewardDiamond.ToString(); if (MyHead != null && MyHead.LblStarNum != null) { MyHead.LblStarNum.text = "[ffffff]" + HaveStar.ToString() + "[-][c7945b]" + "/" + TotalStar.ToString() + "[-]"; } SetUI(); }
/// <summary> /// 获得途径. /// </summary> private void AddGetWay() { AddBanner(0); List <int> lCounpart = StageM.GetRewardFromStage(m_ItemInfo.itemType); if (lCounpart == null || lCounpart.Count < 1) { return; } List <CounterPartInfo> lCounterInfo = StageM.GetCounterPartInfoList(lCounpart); if (lCounterInfo == null || lCounterInfo.Count < 1) { return; } Dictionary <int, int> dl = new Dictionary <int, int>(); PdbbbItem pbbItem = null; GameObject go2 = NDLoad.LoadWndItem("PdbbbItem", MyHead.Table.transform); pbbItem = go2.GetComponent <PdbbbItem>(); if (pbbItem != null && pbbItem.MyHead.Table != null) { pbbItem.MyHead.Table.columns = 2; pbbItem.MyHead.Table.padding.y = 10f; foreach (CounterPartInfo info in lCounterInfo) { // if(info.isboss == 0) continue; if (dl.ContainsKey(info.id)) { continue; } dl.Add(info.id, info.id); GameObject go = NDLoad.LoadWndItem("EquipComeFromItem", pbbItem.MyHead.Table.transform); if (go != null) { EquipComeFromItem item = go.GetComponent <EquipComeFromItem>(); if (item) { item.SetCounterInfoData(info); item.MyHead.BtnItemClick.OnClickEventHandler += (UIButton sender) => { bool Open = StageDC.CheckOpenStage((StageType)info.type, info.id); if (!Open) { NGUIUtil.ShowTipWndByKey(10000175); return; } StageMapWnd wnd = WndManager.GetDialog <StageMapWnd>(); if (wnd != null) { wnd.SetMainMenuTop(false); int stageNode = StageDC.GetStageNode(info.id); int chapter = StageDC.GetStageChapter(info.id); wnd.GotoChapter((StageType)info.type, chapter, stageNode); } EquipInfoWnd InfoWnd = WndManager.FindDialog <EquipInfoWnd>(); if (InfoWnd != null) { WndManager.SetBeforeWnd(wnd, InfoWnd); } };; } } pbbItem.MyHead.Table.Reposition(); pbbItem.MyHead.Table.repositionNow = true; } } }