//-------∽-★-∽------∽-★-∽--------∽-★-∽ApplyGameObjectParam∽-★-∽--------∽-★-∽------∽-★-∽--------// public override void ApplyGameObjectParam(GameObject go, JsonData data) { base.ApplyGameObjectParam(go, data); if (HasParam(data, PATTERN_STATIC) == false) { KScrollView scrollView = go.AddComponent <KScrollView>(); if (HasParam(data, PATTERN_H) == true) { scrollView.direction = KScrollView.ScrollDir.horizontal; } else { scrollView.direction = KScrollView.ScrollDir.vertical; } if (HasParam(data, PATTERN_ADAPT_INPUT)) { //AdaptInputField(go); } //scrollView.Initialize(); GameObject mask = FuzzySearchChild(go, "mask"); GameObject content = FuzzySearchChild(mask, "content"); GameObject item = FuzzySearchChild(content, "item", true); if (item != null) { //有列表项 KListViewScroll list = go.AddComponent <KListViewScroll>(); } } }
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); }
public TestKUIPop3() { m_popId = POP_ID.TEST_KUI_3; m_layerIdx = POP_LAYER_IDX.LAYER_POP_1; ShowGameObject(); m_toggle1 = GetChildByName <KToggle>("Toggle_position1", true); m_toggle1.needReqChange = true; m_toggleGroup1 = GetChildByName <KToggleGroup>("ToggleGroup_1", true); //m_toggleGroup1.allowMultiple = true; //m_toggleGroup1.needReqChange = true; //m_toggleGroup1.allowSwitchOff = true; m_inputName = GetChildByName <KInputField>("Input_name", true); m_buttonAnnounce = GetChildByName <KButton>("Button_SystemAnnounce", true); m_buttonClose = GetChildByName <KButton>("Button_Close", true); m_barExp = GetChildByName <KProgressBar>("ProgressBar_EXP", true); m_sliderSchedule1 = GetChildByName <KSlider>("Slider_Schedule1", true); m_icon1 = GetChildByName <KImage>("Image_Icon1", true); m_scrollViewItemList = GetChildByName <KScrollView>("ScrollView_ItemList", true); }
protected override void AddComponent(GameObject go) { if (HasParam(PARAM_STATIC) == false) //为啥? { KScrollView scrollView = go.AddComponent <KScrollView>(); if (HasParam(PARAM_H) == true) { scrollView.direction = KScrollView.ScrollDir.horizontal; } else { scrollView.direction = KScrollView.ScrollDir.vertical; } scrollView.Initialize(); } }