public void OnEnable() { ScrollPanel scrollPanel = (ScrollPanel)target; mDataProvider = scrollPanel.gameObject.GetComponent <ScrollViewDataProvider>(); mLayoutProvider = scrollPanel.gameObject.GetComponent <ScrollViewLayoutProvider>(); mScrollRect = scrollPanel.GetComponentInChildren <ScrollRect>(); }