void Awake() { Instance = this; base.Init(); m_tab = GetUIChild("EquipExchangeTab").GetComponent<MogoSingleButtonList>(); Transform listRoot = GetUIChild("EquipExchangeEquipList"); m_tranDragableCamera = GetUIChild("EquipExchangeEquipListCamera"); m_dragableCamera = m_tranDragableCamera.GetComponentsInChildren<MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = GetUIChild("EquipExchangeArrowLeft").gameObject; m_dragableCamera.RightArrow = GetUIChild("EquipExchangeArrowRight").gameObject; Transform dragCameraBegin = GetUIChild("EquipExchangeEquipListCameraPosBegin"); GetUIChild("EquipExchangeContainerCloseBtn").gameObject.AddComponent<MogoUIListener>().MogoOnClick = () => { Hide(); }; m_listView = new MogoListView(m_tranDragableCamera, listRoot, dragCameraBegin, GRID_PREFAB_NAME, true, GRID_GAP, GRID_NUM_PER_PAGE, m_objList); m_lblGoldNum = GetUIChild("EquipExchangeResourceGoldNumLbl").GetComponent<UILabel>(); m_lblMaterilNum = GetUIChild("EquipExchangeResourceDiamondNumLbl").GetComponent<UILabel>(); m_imgMaterial = GetUIChild("EquipExchangeResourceDiamondIcon").GetComponent<UISprite>(); GetUIChild("EquipExchangeTabBtn1").gameObject.AddComponent<MogoUIListener>().MogoOnClick = () => { if (OnTabSelect != null) OnTabSelect(0); }; GetUIChild("EquipExchangeTabBtn2").gameObject.AddComponent<MogoUIListener>().MogoOnClick = () => { if (OnTabSelect != null) OnTabSelect(1); }; gameObject.SetActive(false); }
void Awake() { Instance = this; base.Init(); m_tab = GetUIChild("EquipExchangeTab").GetComponent <MogoSingleButtonList>(); Transform listRoot = GetUIChild("EquipExchangeEquipList"); m_tranDragableCamera = GetUIChild("EquipExchangeEquipListCamera"); m_dragableCamera = m_tranDragableCamera.GetComponentsInChildren <MyDragableCamera>(true)[0]; m_dragableCamera.LeftArrow = GetUIChild("EquipExchangeArrowLeft").gameObject; m_dragableCamera.RightArrow = GetUIChild("EquipExchangeArrowRight").gameObject; Transform dragCameraBegin = GetUIChild("EquipExchangeEquipListCameraPosBegin"); GetUIChild("EquipExchangeContainerCloseBtn").gameObject.AddComponent <MogoUIListener>().MogoOnClick = () => { Hide(); }; m_listView = new MogoListView(m_tranDragableCamera, listRoot, dragCameraBegin, GRID_PREFAB_NAME, true, GRID_GAP, GRID_NUM_PER_PAGE, m_objList); m_lblGoldNum = GetUIChild("EquipExchangeResourceGoldNumLbl").GetComponent <UILabel>(); m_lblMaterilNum = GetUIChild("EquipExchangeResourceDiamondNumLbl").GetComponent <UILabel>(); m_imgMaterial = GetUIChild("EquipExchangeResourceDiamondIcon").GetComponent <UISprite>(); GetUIChild("EquipExchangeTabBtn1").gameObject.AddComponent <MogoUIListener>().MogoOnClick = () => { if (OnTabSelect != null) { OnTabSelect(0); } }; GetUIChild("EquipExchangeTabBtn2").gameObject.AddComponent <MogoUIListener>().MogoOnClick = () => { if (OnTabSelect != null) { OnTabSelect(1); } }; gameObject.SetActive(false); }