void OnEnable() { OnBaseEnable(); m_TabView = (TabView)target; m_AutoTrackPages = serializedObject.FindProperty("m_AutoTrackPages"); m_Pages = serializedObject.FindProperty("m_Pages"); m_OnlyShowSelectedPage = serializedObject.FindProperty("m_OnlyShowSelectedPage"); m_TabItemTemplate = serializedObject.FindProperty("m_TabItemTemplate"); m_TabsContainer = serializedObject.FindProperty("m_TabsContainer"); m_PagesContainer = serializedObject.FindProperty("m_PagesContainer"); m_PagesRect = serializedObject.FindProperty("m_PagesRect"); m_Indicator = serializedObject.FindProperty("m_Indicator"); m_ShrinkTabsToFitThreshold = serializedObject.FindProperty("m_ShrinkTabsToFitThreshold"); m_ForceStretchTabsOnLanscape = serializedObject.FindProperty("m_ForceStretchTabsOnLanscape"); m_LowerUnselectedTabAlpha = serializedObject.FindProperty("m_LowerUnselectedTabAlpha"); m_CanScrollBetweenTabs = serializedObject.FindProperty("m_CanScrollBetweenTabs"); m_PagesAnimBool = new AnimBool { value = !m_AutoTrackPages.boolValue }; m_PagesAnimBool.valueChanged.AddListener(Repaint); Selection.selectionChanged += () => m_TabView.TrackPages(); }
void OnEnable() { OnBaseEnable(); m_TabView = (TabView)target; m_AutoTrackPages = serializedObject.FindProperty("m_AutoTrackPages"); m_Pages = serializedObject.FindProperty("m_Pages"); m_OnlyShowSelectedPage = serializedObject.FindProperty("m_OnlyShowSelectedPage"); m_TabItemTemplate = serializedObject.FindProperty("m_TabItemTemplate"); m_TabsContainer = serializedObject.FindProperty("m_TabsContainer"); m_PagesContainer = serializedObject.FindProperty("m_PagesContainer"); m_PagesRect = serializedObject.FindProperty("m_PagesRect"); m_Indicator = serializedObject.FindProperty("m_Indicator"); m_ShrinkTabsToFitThreshold = serializedObject.FindProperty("m_ShrinkTabsToFitThreshold"); m_ForceStretchTabsOnLanscape = serializedObject.FindProperty("m_ForceStretchTabsOnLanscape"); m_LowerUnselectedTabAlpha = serializedObject.FindProperty("m_LowerUnselectedTabAlpha"); m_CanScrollBetweenTabs = serializedObject.FindProperty("m_CanScrollBetweenTabs"); m_PagesAnimBool = new AnimBool { value = !m_AutoTrackPages.boolValue }; m_PagesAnimBool.valueChanged.AddListener(Repaint); }