private void DrawDebugSection() { if (InspectorUIUtility.DrawSectionFoldoutWithKey("Debug Options", ShowDebugOptionsPrefKey, MixedRealityStylesUtility.BoldFoldoutStyle)) { using (new EditorGUI.IndentLevelScope()) { using (var check = new EditorGUI.ChangeCheckScope()) { EditorGUILayout.PropertyField(maskEnabled); if (check.changed) { scrollView.MaskEnabled = maskEnabled.boolValue; } } using (new EditorGUI.DisabledGroupScope(EditorApplication.isPlaying)) { visibleDebugPlanes = EditorGUILayout.Toggle("Show Threshold Planes", visibleDebugPlanes); EditorGUILayout.Space(); } } using (new EditorGUI.IndentLevelScope()) { using (new EditorGUI.DisabledGroupScope(!EditorApplication.isPlaying)) { if (ShowDebugPagination = EditorGUILayout.Foldout(ShowDebugPagination, new GUIContent("Debug Pagination", "Pagination is only available during playmode."), MixedRealityStylesUtility.BoldFoldoutStyle)) { using (new EditorGUI.IndentLevelScope()) { animateTransition = EditorGUILayout.Toggle(new GUIContent("Animate", "Toggling will use animation to move scroller to new position."), animateTransition); using (new EditorGUILayout.HorizontalScope()) { debugPaginationMode = (PaginationMode)EditorGUILayout.EnumPopup(new GUIContent("Pagination Mode"), debugPaginationMode, GUILayout.Width(400.0f)); paginationMoveNumber = EditorGUILayout.IntField(paginationMoveNumber); if (GUILayout.Button("Move")) { switch (debugPaginationMode) { case PaginationMode.ByTier: default: scrollView.MoveByTiers(paginationMoveNumber, animateTransition); break; case PaginationMode.ByPage: scrollView.MoveByPages(paginationMoveNumber, animateTransition); break; case PaginationMode.ToCellIndex: scrollView.MoveToIndex(paginationMoveNumber, animateTransition); break; } } } } } } } } }
/// <summary> /// Smoothly moves the scroll container a relative number of tiers of cells. /// </summary> public void ScrollByTier(int amount) { Debug.Assert(ScrollView != null, "Scroll view needs to be defined before using pagination."); scrollView.MoveByTiers(amount); }
public void ScrollByTier(int amount) { scrollView.MoveByTiers(amount); }