示例#1
0
    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);
                }
            }
        }
    }
示例#2
0
    /// <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;
            }
        }
    }