示例#1
0
    void ClearLayout()
    {
        foreach (var kvp in m_idx2item)
        {
            GameObjUtil.Delete(kvp.Value);
        }

        m_idx2item.Clear();
    }
示例#2
0
    void OnKeyPress(object evt_)
    {
        KeyCode key = (KeyCode)evt_;

        switch (key)
        {
        case KeyCode.RightArrow:

            //m_inputName.GainFocus();
            AppExp(5);
            SprAtlasCache.me.UnloadSprite("npc1026");

            break;

        case KeyCode.LeftArrow:

            SubExp(5);
            SprAtlasCache.me.LoadSprite(this, m_icon1, "npc1026", "npc1026_mini", true);

            break;

        case KeyCode.UpArrow:

            Log.Debug(m_icon1 != null ? "还活着" : "挂了");

            break;

        case KeyCode.DownArrow:

            GameObjUtil.Delete(m_icon1.gameObject);

            break;

        case KeyCode.Keypad1:

            m_listViewScroll.JumpToIndex(4, KListViewScroll.JumpPosType.TOP);

            break;

        case KeyCode.Keypad2:

            m_listViewScroll.JumpToIndex(4, KListViewScroll.JumpPosType.CENTER);

            break;

        case KeyCode.Keypad3:

            //m_listViewScroll.JumpToIndex(4, KListViewScroll.JumpPosType.BOTTOM);
            m_listViewScroll.JumpToTop();
            break;

        case KeyCode.Keypad4:

            List <int> datas = new List <int>();
            int        num   = 5;
            for (int i = 0; i < num; ++i)
            {
                datas.Add(i);
            }

            m_listViewScroll.ShowList(datas);

            break;
        }
    }