예제 #1
0
    public TestPop4()
    {
        m_popId    = POP_ID.TEST_POP_4;
        m_layerIdx = POP_LAYER_IDX.LAYER_POP_1;

        ShowGameObject();

        //
        m_btnOk    = GetChildByName <KButton>("Button_Ok", true);
        m_btnClose = GetChildByName <KButton>("Button_Close", true);

        m_panel = GameObjUtil.GetParent(m_btnOk.gameObject);

        //
        m_inputName      = GetChildByName <KInputField>("Input_name", true);
        m_labelTestInput = GetChildByName <KText>("Label_testInput", true);
        //
        m_tgl_1      = GetChildByName <KToggle>("Toggle_position1", true);
        m_labelTgl_1 = GetChildByName <KText>(m_tgl_1.gameObject, "Label_Text", true);
        m_tglGroup_1 = GetChildByName <KToggleGroup>("ToggleGroup_a1", true);
        //
        m_sliderSchedule = GetChildByName <KSlider>("Slider_Schedule1", true);
        m_labelSchedule  = GetChildByName <KText>("Label_testSilder", true);
        //
        m_barLoading = GetChildByName <KProgressBar>("ProgressBar_loading", true);
        //
        m_icon = GetChildByName <KImage>("Image_sharedAnchor", true);
        //
        m_scrollView = GetChildByName <KScrollView>("ScrollView_GuildList", true);
        m_listView   = ComponentUtil.EnsureComponent <KListViewScroll>(m_scrollView.gameObject);
    }
예제 #2
0
    //-------∽-★-∽------∽-★-∽--------∽-★-∽Layout∽-★-∽--------∽-★-∽------∽-★-∽--------//

    void ShowLayout()
    {
        LayoutParam param = new LayoutParam {
        };

        param.padding = new Padding(20, 20, 20, 20);
        param.itemGap = new Vector2(50, 50);
        param.divNum  = 2;

        GameObject itemGo    = GameObjUtil.FindChild(m_scrollViewItemList.gameObject, "Image_mask/Container_content/Container_Item");
        GameObject container = GameObjUtil.GetParent(itemGo);

        itemGo.SetActive(false);

        for (var i = 0; i < 10; ++i)
        {
            GameObject item = GameObjUtil.Instantiate(itemGo);

            item.SetActive(true);
            GameObjUtil.ChangeParent(item, container);

            LayoutUtil.LayItem(param, i, item);

            m_idx2item[i] = item;
        }
    }