예제 #1
0
 private void Init()
 {
     m_scrollRect = GetComponentInChildren <LoopVerticalScrollRect>();
     m_head       = GetComponentInChildren <WHead>();
     Assert.IsNotNull(m_scrollRect);
     Assert.IsNotNull(m_head);
     m_scrollRectTransform    = m_scrollRect.GetComponent <RectTransform>();
     m_scrollbarRectTransform = m_scrollRect.verticalScrollbar.GetComponent <RectTransform>();
     Assert.IsNotNull(m_scrollRectTransform);
     Assert.IsNotNull(m_scrollbarRectTransform);
     m_init = true;
 }
예제 #2
0
        private void Init()
        {
            m_scrollRect = GetComponentInChildren <LoopVerticalScrollRect>();
            m_head       = GetComponentInChildren <WHead>();
            Assert.IsNotNull(m_scrollRect);
            Assert.IsNotNull(m_head);
            m_scrollRectTransform    = m_scrollRect.GetComponent <RectTransform>();
            m_destoryButton          = GetComponentInChildren <Button>();
            m_scrollbarRectTransform = m_scrollRect.verticalScrollbar.GetComponent <RectTransform>();
            Assert.IsNotNull(m_scrollRectTransform);
            Assert.IsNotNull(m_scrollbarRectTransform);

            m_destoryButton.onClick.AddListener(() =>
            {
                if (isDestroyAble)
                {
                    Destroy(this.gameObject);
                }
            });

            m_init = true;
        }