1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System.Collections.Generic;
- using FairyGUI;
- using UI.Studio;
- namespace GFGGame
- {
- public class StudioPropertyView : StudioBaseView
- {
- //书画副本
- public override void Dispose()
- {
- base.Dispose();
- }
- protected override void OnInit()
- {
- base.OnInit();
- _ui.m_btnBack.onClick.Add(OnClickBtnBack);
- _ui.m_listProperty.itemRenderer = ListPropertyItemRender;
- _ui.m_listProperty.onClickItem.Add(OnClickListProperty);
- }
- protected override void OnShown()
- {
- _ui.m_c1.selectedIndex = 1;
- _ui.m_listProperty.numItems = StudioDataManager.Instance.GetStudioCfgListByViewName(typeof(StudioPropertyView).FullName).Count;
- base.OnShown();
- }
- protected override void OnHide()
- {
- base.OnHide();
- }
- private void OnClickBtnBack()
- {
- ViewManager.GoBackFrom(typeof(StudioPropertyView).FullName);
- }
- private void ListPropertyItemRender(int index, GObject obj)
- {
- GButton item = obj.asButton;
- item.data = StudioCfgArray.Instance.GetCfgs(typeof(StudioMetalView).FullName)[index];
- }
- private void OnClickListProperty(EventContext context)
- {
- GButton item = (context.data as GObject).asButton;
- // UI_ListPropertyItem item = UI_ListPropertyItem.Proxy(context.data as GObject);
- this.studioCfg = item.data as StudioCfg;
- this.storyLevelCfgs = StoryLevelCfgArray.Instance.GetCfgs(this.studioCfg.type, this.studioCfg.subType, this.studioCfg.id);
- _ui.m_list.numItems = this.storyLevelCfgs.Length;
- }
- }
- }
|