From ff7192f29c65da65f46b3389d434b0a2d453bdc3 Mon Sep 17 00:00:00 2001 From: MichaelO Date: Wed, 1 Nov 2023 13:16:49 +0800 Subject: [PATCH] updated to v1.3.1 --- .../InfiniteScrollView/Scripts/CHANGELOG.md | 5 + .../HorizontalGridInfiniteScrollView.cs | 4 +- .../Scripts/Runtime/InfiniteCellData.cs | 10 +- .../Scripts/Runtime/InfiniteScrollView.cs | 24 +- .../Runtime/VerticalGridInfiniteScrollView.cs | 4 +- .../Normal/01_Vertical_Normal.unity | 11 +- .../Reverse/01_Vertical_Reverse.unity | 10 +- .../Normal/02_Horizontal_Normal.unity | 10 +- .../Reverse/02_Horizontal_Reverse.unity | 12 +- .../Horizontal/Normal/03_Grid_H_Normal.unity | 122 +++++- .../Normal/Horizontal Grid Scroll View.prefab | 384 +++++++++--------- .../Reverse/03_Grid_H_Reverse.unity | 40 +- .../Horizontal Grid Scroll View.prefab | 20 +- .../Vertical/Normal/03_Grid_V_Normal.unity | 19 +- .../Vertical/Reverse/03_Grid_V_Reverse.unity | 23 +- .../Samples~/05_ChatRoom/05_ChatRoom.unity | 23 +- .../Samples~/05_ChatRoom/TestGUI_05.cs | 10 +- .../InfiniteScrollView/Scripts/package.json | 2 +- UserSettings/EditorUserSettings.asset | 18 +- 19 files changed, 446 insertions(+), 305 deletions(-) diff --git a/Assets/InfiniteScrollView/Scripts/CHANGELOG.md b/Assets/InfiniteScrollView/Scripts/CHANGELOG.md index c45dc85..e50995e 100644 --- a/Assets/InfiniteScrollView/Scripts/CHANGELOG.md +++ b/Assets/InfiniteScrollView/Scripts/CHANGELOG.md @@ -1,5 +1,10 @@ ## CHANGELOG +## [1.3.1] - 2023-11-01 +- Fixed determines. +- Modified Samples. +- Optimzied Recycle and SetupCell procedure. + ## [1.3.0] - 2023-10-31 - Modified All infiniteScrollViews can auto calculate direction by content and cell pivot. - Modified Samples (Normal direction and Reverse direction). diff --git a/Assets/InfiniteScrollView/Scripts/Runtime/HorizontalGridInfiniteScrollView.cs b/Assets/InfiniteScrollView/Scripts/Runtime/HorizontalGridInfiniteScrollView.cs index f66497a..34696d1 100644 --- a/Assets/InfiniteScrollView/Scripts/Runtime/HorizontalGridInfiniteScrollView.cs +++ b/Assets/InfiniteScrollView/Scripts/Runtime/HorizontalGridInfiniteScrollView.cs @@ -66,9 +66,9 @@ public override void RefreshCellVisibility() if (cell != null) dirCoeff = cell.RectTransform.pivot.x > 0 ? -1f : 1f; SetupCell(cell, index, new Vector2(contentWidth * dirCoeff, (dataList[index].cellSize.y + spacing.y) * -j + -(padding.top - padding.bottom))); if (visibleRange.y >= viewportRange.x) - cellList[index].transform.SetAsLastSibling(); + cellList[index]?.transform.SetAsLastSibling(); else - cellList[index].transform.SetAsFirstSibling(); + cellList[index]?.transform.SetAsFirstSibling(); } } contentWidth += dataList[i].cellSize.x + spacing.x; diff --git a/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteCellData.cs b/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteCellData.cs index 0fc75a8..6742866 100644 --- a/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteCellData.cs +++ b/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteCellData.cs @@ -1,8 +1,9 @@ -using UnityEngine; +using System; +using UnityEngine; namespace HowTungTung { - public class InfiniteCellData + public class InfiniteCellData : IDisposable { public int index { get; internal set; } public Vector2 cellSize; @@ -23,5 +24,10 @@ public InfiniteCellData(Vector2 cellSize, object data) this.cellSize = cellSize; this.data = data; } + + public void Dispose() + { + this.data = null; + } } } \ No newline at end of file diff --git a/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteScrollView.cs b/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteScrollView.cs index 14bcc48..de4237b 100644 --- a/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteScrollView.cs +++ b/Assets/InfiniteScrollView/Scripts/Runtime/InfiniteScrollView.cs @@ -190,6 +190,7 @@ public virtual async UniTask Remove(int index, bool autoRefresh = true) index < 0) return; + dataList[index].Dispose(); dataList.RemoveAt(index); this.RefreshCellDataIndex(index); RecycleCell(index); @@ -351,13 +352,14 @@ private async UniTask ProcessSnapping(Vector2 target, float duration) protected void SetupCell(InfiniteCell cell, int index, Vector2 pos) { - if (cell == null) return; - - cell.gameObject.SetActive(true); - cell.CellData = dataList[index]; - cell.RectTransform.anchoredPosition = pos; - cellList[index] = cell; - cell.onSelected += OnCellSelected; + if (cell != null) + { + cellList[index] = cell; + cell.CellData = dataList[index]; + cell.RectTransform.anchoredPosition = pos; + cell.onSelected += OnCellSelected; + cell.gameObject.SetActive(true); + } } protected void RecycleCell(int index) @@ -366,10 +368,10 @@ protected void RecycleCell(int index) { var cell = cellList[index]; cellList[index] = null; - _cellPool.Enqueue(cell); + cell.onSelected -= OnCellSelected; cell.gameObject.SetActive(false); cell.OnRecycle(); - cell.onSelected -= OnCellSelected; + _cellPool.Enqueue(cell); } } @@ -388,6 +390,10 @@ public virtual async UniTask Clear() await InitializePool(); scrollRect.velocity = Vector2.zero; scrollRect.content.anchoredPosition = Vector2.zero; + for (int i = 0; i < dataList.Count; i++) + { + dataList[i].Dispose(); + } dataList.Clear(); for (int i = 0; i < cellList.Count; i++) { diff --git a/Assets/InfiniteScrollView/Scripts/Runtime/VerticalGridInfiniteScrollView.cs b/Assets/InfiniteScrollView/Scripts/Runtime/VerticalGridInfiniteScrollView.cs index a90fd3a..c0ecf90 100644 --- a/Assets/InfiniteScrollView/Scripts/Runtime/VerticalGridInfiniteScrollView.cs +++ b/Assets/InfiniteScrollView/Scripts/Runtime/VerticalGridInfiniteScrollView.cs @@ -66,9 +66,9 @@ public override void RefreshCellVisibility() if (cell != null) dirCoeff = cell.RectTransform.pivot.y > 0 ? -1f : 1f; SetupCell(cell, index, new Vector2((dataList[index].cellSize.x + spacing.x) * j + (padding.left - padding.right), contentHeight * dirCoeff)); if (visibleRange.y >= viewportRange.x) - cellList[index].transform.SetAsLastSibling(); + cellList[index]?.transform.SetAsLastSibling(); else - cellList[index].transform.SetAsFirstSibling(); + cellList[index]?.transform.SetAsFirstSibling(); } } contentHeight += dataList[i].cellSize.y + spacing.y; diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Normal/01_Vertical_Normal.unity b/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Normal/01_Vertical_Normal.unity index d82dabc..bf5a9ff 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Normal/01_Vertical_Normal.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Normal/01_Vertical_Normal.unity @@ -374,7 +374,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 30, y: 30} - m_SizeDelta: {x: 288.41, y: 0} + m_SizeDelta: {x: 290, y: 0} m_Pivot: {x: 0, y: 0} --- !u!114 &2096381313 MonoBehaviour: @@ -426,12 +426,11 @@ MonoBehaviour: m_Text: 'Vertical Normal Conditions: - 1. Viewport content pivot (x, - y) = (0, 1) and align [Stretch-Top]. + 1. Viewport content pivot (x, y) = (0, + 1) and align [Stretch-Top]. - 2. Cell pivot (x, y) = (0, 1) - and align [Left-Top].' + 2. Cell pivot (x, y) = (0, 1) and align [Left-Top].' --- !u!222 &2096381315 CanvasRenderer: m_ObjectHideFlags: 0 @@ -575,7 +574,7 @@ PrefabInstance: - target: {fileID: 1855459386986698912, guid: a17a812836c754f11a7ba8e246512cd8, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 0.00067811005 objectReference: {fileID: 0} - target: {fileID: 1855459387362808913, guid: a17a812836c754f11a7ba8e246512cd8, type: 3} diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Reverse/01_Vertical_Reverse.unity b/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Reverse/01_Vertical_Reverse.unity index e6c1052..f643968 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Reverse/01_Vertical_Reverse.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/01_Vertical/Reverse/01_Vertical_Reverse.unity @@ -534,7 +534,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 30, y: 30} - m_SizeDelta: {x: 288.41, y: 0} + m_SizeDelta: {x: 290, y: 0} m_Pivot: {x: 0, y: 0} --- !u!114 &2100359777 MonoBehaviour: @@ -586,12 +586,12 @@ MonoBehaviour: m_Text: 'Vertical Reverse Conditions: - 1. Viewport content pivot (x, - y) = (0, 0) and align [Stretch-Bottom]. + 1. Viewport content pivot (x, y) = + (0, 0) and align [Stretch-Bottom]. - 2. Cell pivot (x, y) = (0, - 0) and align [Left-Bottom].' + 2. Cell pivot (x, y) = (0, 0) and align + [Left-Bottom].' --- !u!222 &2100359779 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Normal/02_Horizontal_Normal.unity b/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Normal/02_Horizontal_Normal.unity index 663d18c..880ec26 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Normal/02_Horizontal_Normal.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Normal/02_Horizontal_Normal.unity @@ -161,7 +161,7 @@ RectTransform: m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -30, y: -30} - m_SizeDelta: {x: 288.41003, y: 0} + m_SizeDelta: {x: 290, y: 0} m_Pivot: {x: 1, y: 1} --- !u!114 &272292816 MonoBehaviour: @@ -213,12 +213,12 @@ MonoBehaviour: m_Text: 'Horizontal Normal Conditions: - 1. Viewport content pivot (x, - y) = (0, 1) and align [Stretch-Left]. + 1. Viewport content pivot (x, y) = + (0, 1) and align [Stretch-Left]. - 2. Cell pivot (x, y) = (0, 1) - and align [Left-Top].' + 2. Cell pivot (x, y) = (0, 1) and align + [Left-Top].' --- !u!222 &272292818 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Reverse/02_Horizontal_Reverse.unity b/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Reverse/02_Horizontal_Reverse.unity index ce0289b..1c7eb57 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Reverse/02_Horizontal_Reverse.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/02_Horizontal/Reverse/02_Horizontal_Reverse.unity @@ -299,7 +299,7 @@ PrefabInstance: - target: {fileID: 7911875008147736594, guid: 421612e6beac0d541a07ea5d97bb7677, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 0.00079345703 objectReference: {fileID: 0} - target: {fileID: 7911875008147736594, guid: 421612e6beac0d541a07ea5d97bb7677, type: 3} @@ -518,7 +518,7 @@ RectTransform: m_AnchorMin: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: -30, y: -30} - m_SizeDelta: {x: 288.41003, y: 0} + m_SizeDelta: {x: 290, y: 0} m_Pivot: {x: 1, y: 1} --- !u!114 &2039907101 MonoBehaviour: @@ -570,12 +570,12 @@ MonoBehaviour: m_Text: 'Horizontal Reverse Conditions: - 1. Viewport content pivot (x, - y) = (1, 1) and align [Stretch-Right]. + 1. Viewport content pivot (x, y) + = (1, 1) and align [Stretch-Right]. - 2. Cell pivot (x, y) = (1, - 1) and align [Right-Top].' + 2. Cell pivot (x, y) = (1, 1) and + align [Right-Top].' --- !u!222 &2039907103 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/03_Grid_H_Normal.unity b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/03_Grid_H_Normal.unity index 1419049..21c5a5e 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/03_Grid_H_Normal.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/03_Grid_H_Normal.unity @@ -130,6 +130,21 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 3610145948686078249} m_Modifications: + - target: {fileID: 1740325061323001304, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1740325061323001304, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1740325061323001304, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2517611821655893668, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: _isAtTop @@ -138,7 +153,7 @@ PrefabInstance: - target: {fileID: 2517611821655893668, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: rowCount - value: 10 + value: 8 objectReference: {fileID: 0} - target: {fileID: 2517611821655893668, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} @@ -170,6 +185,11 @@ PrefabInstance: propertyPath: cellPoolSize value: 50 objectReference: {fileID: 0} + - target: {fileID: 4465912298698047133, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchoredPosition.x + value: -0.00018394848 + objectReference: {fileID: 0} - target: {fileID: 4465912299598443116, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_AnchorMax.x @@ -185,6 +205,51 @@ PrefabInstance: propertyPath: m_AnchorMin.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 4465912300294090192, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Name + value: Scrollbar Horizontal + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Pivot.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Pivot.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_SizeDelta.y + value: 20 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912300294090193, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4465912300404621520, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_Name @@ -213,7 +278,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} @@ -223,17 +288,17 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_SizeDelta.x - value: 400 + value: 430 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 830 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} @@ -273,7 +338,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: m_AnchoredPosition.x - value: -200 + value: -215 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} @@ -320,6 +385,41 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 4465912300486386431, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5488463333630739307, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5488463333630739307, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Value + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5488463333630739307, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_Direction + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6102272209566602200, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_SizeDelta.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6102272209566602200, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_SizeDelta.y + value: 20 + objectReference: {fileID: 0} + - target: {fileID: 6102272209566602200, guid: f3912473f34092b4c9a7a553eb7be680, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} - target: {fileID: 8142308267430827509, guid: f3912473f34092b4c9a7a553eb7be680, type: 3} propertyPath: columeCount @@ -589,7 +689,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 30, y: 30} - m_SizeDelta: {x: 288.41, y: 0} + m_SizeDelta: {x: 290, y: 0} m_Pivot: {x: 0, y: 0} --- !u!114 &1721184655 MonoBehaviour: @@ -641,12 +741,12 @@ MonoBehaviour: m_Text: 'Horizontal Normal Conditions: - 1. Viewport content pivot (x, - y) = (0, 1) and align [Stretch-Left]. + 1. Viewport content pivot (x, y) = + (0, 1) and align [Stretch-Left]. - 2. Cell pivot (x, y) = (0, 1) - and align [Left-Top].' + 2. Cell pivot (x, y) = (0, 1) and align + [Left-Top].' --- !u!222 &1721184657 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/Horizontal Grid Scroll View.prefab b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/Horizontal Grid Scroll View.prefab index cf73223..4146df9 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/Horizontal Grid Scroll View.prefab +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Normal/Horizontal Grid Scroll View.prefab @@ -1,42 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &4465912298698047132 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4465912298698047133} - m_Layer: 5 - m_Name: Content - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4465912298698047133 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912298698047132} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 4465912300486386431} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 383, y: 0} - m_Pivot: {x: 0, y: 1} ---- !u!1 &4465912299349108988 +--- !u!1 &2090437927109245990 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -44,46 +8,9 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 4465912299349108989} - m_Layer: 5 - m_Name: Sliding Area - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &4465912299349108989 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912299349108988} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4465912299598443116} - m_Father: {fileID: 4465912300294090193} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: -20, y: -20} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!1 &4465912299598443115 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4465912299598443116} - - component: {fileID: 4465912299598443118} - - component: {fileID: 4465912299598443117} + - component: {fileID: 1740325061323001304} + - component: {fileID: 4144897846097117499} + - component: {fileID: 5578878616074013747} m_Layer: 5 m_Name: Handle m_TagString: Untagged @@ -91,19 +18,19 @@ GameObject: m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &4465912299598443116 +--- !u!224 &1740325061323001304 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912299598443115} + m_GameObject: {fileID: 2090437927109245990} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 4465912299349108989} + m_Father: {fileID: 5190643963029706527} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -111,21 +38,21 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 20, y: 20} m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &4465912299598443118 +--- !u!222 &4144897846097117499 CanvasRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912299598443115} + m_GameObject: {fileID: 2090437927109245990} m_CullTransparentMesh: 0 ---- !u!114 &4465912299598443117 +--- !u!114 &5578878616074013747 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912299598443115} + m_GameObject: {fileID: 2090437927109245990} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} @@ -149,7 +76,7 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &4465912300294090192 +--- !u!1 &4465912298698047132 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -157,125 +84,34 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 4465912300294090193} - - component: {fileID: 4465912300294090196} - - component: {fileID: 4465912300294090195} - - component: {fileID: 4465912300294090194} + - component: {fileID: 4465912298698047133} m_Layer: 5 - m_Name: Scrollbar Vertical + m_Name: Content m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!224 &4465912300294090193 +--- !u!224 &4465912298698047133 RectTransform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912300294090192} + m_GameObject: {fileID: 4465912298698047132} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 4465912299349108989} - m_Father: {fileID: 4465912300404621521} - m_RootOrder: 1 + m_Children: [] + m_Father: {fileID: 4465912300486386431} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 1} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} - m_Pivot: {x: 1, y: 1} ---- !u!222 &4465912300294090196 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912300294090192} - m_CullTransparentMesh: 0 ---- !u!114 &4465912300294090195 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912300294090192} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} - m_Type: 1 - m_PreserveAspect: 0 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 ---- !u!114 &4465912300294090194 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4465912300294090192} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Navigation: - m_Mode: 3 - m_WrapAround: 0 - m_SelectOnUp: {fileID: 0} - m_SelectOnDown: {fileID: 0} - m_SelectOnLeft: {fileID: 0} - m_SelectOnRight: {fileID: 0} - m_Transition: 1 - m_Colors: - m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} - m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} - m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} - m_ColorMultiplier: 1 - m_FadeDuration: 0.1 - m_SpriteState: - m_HighlightedSprite: {fileID: 0} - m_PressedSprite: {fileID: 0} - m_SelectedSprite: {fileID: 0} - m_DisabledSprite: {fileID: 0} - m_AnimationTriggers: - m_NormalTrigger: Normal - m_HighlightedTrigger: Highlighted - m_PressedTrigger: Pressed - m_SelectedTrigger: Selected - m_DisabledTrigger: Disabled - m_Interactable: 1 - m_TargetGraphic: {fileID: 4465912299598443117} - m_HandleRect: {fileID: 4465912299598443116} - m_Direction: 2 - m_Value: 0 - m_Size: 1 - m_NumberOfSteps: 0 - m_OnValueChanged: - m_PersistentCalls: - m_Calls: [] + m_SizeDelta: {x: 383, y: 0} + m_Pivot: {x: 0, y: 1} --- !u!1 &4465912300404621520 GameObject: m_ObjectHideFlags: 0 @@ -309,7 +145,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 4465912300486386431} - - {fileID: 4465912300294090193} + - {fileID: 6102272209566602200} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -377,8 +213,8 @@ MonoBehaviour: m_DecelerationRate: 0.135 m_ScrollSensitivity: 1 m_Viewport: {fileID: 4465912300486386431} - m_HorizontalScrollbar: {fileID: 0} - m_VerticalScrollbar: {fileID: 4465912300294090194} + m_HorizontalScrollbar: {fileID: 5488463333630739307} + m_VerticalScrollbar: {fileID: 0} m_HorizontalScrollbarVisibility: 2 m_VerticalScrollbarVisibility: 2 m_HorizontalScrollbarSpacing: -3 @@ -400,9 +236,9 @@ MonoBehaviour: m_EditorClassIdentifier: initializePoolOnAwake: 0 cellPoolSize: 20 - extendVisibleRange: 0 cellPrefab: {fileID: 4412591906369119776, guid: 9d8a6e7f85ecb924b9a74187f6539292, type: 3} + extendVisibleRange: 0 scrollRect: {fileID: 0} cellList: [] snapAlign: 1 @@ -413,8 +249,6 @@ MonoBehaviour: right: 0 spacing: {x: 0, y: 0} rowCount: 1 - isAtLeft: 1 - isAtRight: 1 --- !u!1 &4465912300486386430 GameObject: m_ObjectHideFlags: 0 @@ -506,3 +340,167 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_ShowMaskGraphic: 0 +--- !u!1 &6499983157607734651 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5190643963029706527} + m_Layer: 5 + m_Name: Sliding Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5190643963029706527 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6499983157607734651} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1740325061323001304} + m_Father: {fileID: 6102272209566602200} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: -20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &6902282329329855961 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6102272209566602200} + - component: {fileID: 6666883457125347010} + - component: {fileID: 6153499497548131351} + - component: {fileID: 5488463333630739307} + m_Layer: 5 + m_Name: Scrollbar Horizontal + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6102272209566602200 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6902282329329855961} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 5190643963029706527} + m_Father: {fileID: 4465912300404621521} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0, y: 0} +--- !u!222 &6666883457125347010 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6902282329329855961} + m_CullTransparentMesh: 0 +--- !u!114 &6153499497548131351 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6902282329329855961} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &5488463333630739307 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6902282329329855961} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2a4db7a114972834c8e4117be1d82ba3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 5578878616074013747} + m_HandleRect: {fileID: 1740325061323001304} + m_Direction: 0 + m_Value: 1 + m_Size: 1 + m_NumberOfSteps: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/03_Grid_H_Reverse.unity b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/03_Grid_H_Reverse.unity index 611d6ff..a5d2d15 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/03_Grid_H_Reverse.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/03_Grid_H_Reverse.unity @@ -130,6 +130,11 @@ PrefabInstance: m_Modification: m_TransformParent: {fileID: 3610145948686078249} m_Modifications: + - target: {fileID: 4465912298698047133, guid: 60a5569cec5c18f44a650bb4454cb98f, + type: 3} + propertyPath: m_AnchoredPosition.x + value: 0.000091552734 + objectReference: {fileID: 0} - target: {fileID: 4465912299598443116, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_AnchorMax.x @@ -140,6 +145,16 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 4465912299598443116, guid: 60a5569cec5c18f44a650bb4454cb98f, + type: 3} + propertyPath: m_AnchorMin.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4465912299598443116, guid: 60a5569cec5c18f44a650bb4454cb98f, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4465912300404621520, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_Name @@ -168,7 +183,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} @@ -178,17 +193,17 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_SizeDelta.x - value: 400 + value: 430 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 830 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} @@ -228,7 +243,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: m_AnchoredPosition.x - value: -200 + value: -215 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} @@ -265,6 +280,11 @@ PrefabInstance: propertyPath: m_SizeDelta.x value: 0 objectReference: {fileID: 0} + - target: {fileID: 4465912300486386431, guid: 60a5569cec5c18f44a650bb4454cb98f, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 6061774034286898766, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: _isAtTop @@ -273,7 +293,7 @@ PrefabInstance: - target: {fileID: 6061774034286898766, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} propertyPath: rowCount - value: 10 + value: 8 objectReference: {fileID: 0} - target: {fileID: 6061774034286898766, guid: 60a5569cec5c18f44a650bb4454cb98f, type: 3} @@ -470,12 +490,12 @@ MonoBehaviour: m_Text: 'Horizontal Reverse Conditions: - 1. Viewport content pivot (x, - y) = (1, 1) and align [Stretch-Right]. + 1. Viewport content pivot (x, y) + = (1, 1) and align [Stretch-Right]. - 2. Cell pivot (x, y) = (1, - 1) and align [Right-Top].' + 2. Cell pivot (x, y) = (1, 1) and + align [Right-Top].' --- !u!222 &1123013426 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/Horizontal Grid Scroll View.prefab b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/Horizontal Grid Scroll View.prefab index 078764b..d7bdf0c 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/Horizontal Grid Scroll View.prefab +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Horizontal/Reverse/Horizontal Grid Scroll View.prefab @@ -162,7 +162,7 @@ GameObject: - component: {fileID: 4465912300294090195} - component: {fileID: 4465912300294090194} m_Layer: 5 - m_Name: Scrollbar Vertical + m_Name: Scrollbar Horizontal m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -184,11 +184,11 @@ RectTransform: m_Father: {fileID: 4465912300404621521} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 1} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 20, y: 0} - m_Pivot: {x: 1, y: 1} + m_SizeDelta: {x: 0, y: 20} + m_Pivot: {x: 0, y: 0} --- !u!222 &4465912300294090196 CanvasRenderer: m_ObjectHideFlags: 0 @@ -269,7 +269,7 @@ MonoBehaviour: m_Interactable: 1 m_TargetGraphic: {fileID: 4465912299598443117} m_HandleRect: {fileID: 4465912299598443116} - m_Direction: 2 + m_Direction: 0 m_Value: 0 m_Size: 1 m_NumberOfSteps: 0 @@ -377,8 +377,8 @@ MonoBehaviour: m_DecelerationRate: 0.135 m_ScrollSensitivity: 1 m_Viewport: {fileID: 4465912300486386431} - m_HorizontalScrollbar: {fileID: 0} - m_VerticalScrollbar: {fileID: 4465912300294090194} + m_HorizontalScrollbar: {fileID: 4465912300294090194} + m_VerticalScrollbar: {fileID: 0} m_HorizontalScrollbarVisibility: 2 m_VerticalScrollbarVisibility: 2 m_HorizontalScrollbarSpacing: -3 @@ -400,9 +400,9 @@ MonoBehaviour: m_EditorClassIdentifier: initializePoolOnAwake: 0 cellPoolSize: 20 - extendVisibleRange: 0 cellPrefab: {fileID: 4412591906369119776, guid: 835131a9b9edf3c469d5f9ee33ccf517, type: 3} + extendVisibleRange: 0 scrollRect: {fileID: 0} cellList: [] snapAlign: 1 @@ -413,8 +413,6 @@ MonoBehaviour: right: 0 spacing: {x: 0, y: 0} rowCount: 1 - isAtLeft: 1 - isAtRight: 1 --- !u!1 &4465912300486386430 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Normal/03_Grid_V_Normal.unity b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Normal/03_Grid_V_Normal.unity index 015b606..0071b1c 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Normal/03_Grid_V_Normal.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Normal/03_Grid_V_Normal.unity @@ -426,12 +426,11 @@ MonoBehaviour: m_Text: 'Vertical Normal Conditions: - 1. Viewport content pivot (x, - y) = (0, 1) and align [Stretch-Top]. + 1. Viewport content pivot (x, y) = (0, + 1) and align [Stretch-Top]. - 2. Cell pivot (x, y) = (0, 1) - and align [Left-Top].' + 2. Cell pivot (x, y) = (0, 1) and align [Left-Top].' --- !u!222 &1871247934 CanvasRenderer: m_ObjectHideFlags: 0 @@ -450,7 +449,7 @@ PrefabInstance: - target: {fileID: 4465912298698047133, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: 0.0006788124 objectReference: {fileID: 0} - target: {fileID: 4465912299598443116, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} @@ -495,7 +494,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} @@ -505,17 +504,17 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_SizeDelta.x - value: 400 + value: 430 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 830 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} @@ -555,7 +554,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} propertyPath: m_AnchoredPosition.x - value: -200 + value: -215 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: 6baabc37d1a8945259d802a7804d9422, type: 3} diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Reverse/03_Grid_V_Reverse.unity b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Reverse/03_Grid_V_Reverse.unity index 33d4617..a133f7d 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Reverse/03_Grid_V_Reverse.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/03_Grid/Vertical/Reverse/03_Grid_V_Reverse.unity @@ -212,12 +212,12 @@ MonoBehaviour: m_Text: 'Vertical Reverse Conditions: - 1. Viewport content pivot (x, - y) = (0, 0) and align [Stretch-Bottom]. + 1. Viewport content pivot (x, y) = + (0, 0) and align [Stretch-Bottom]. - 2. Cell pivot (x, y) = (0, - 0) and align [Left-Bottom].' + 2. Cell pivot (x, y) = (0, 0) and align + [Left-Bottom].' --- !u!222 &405701624 CanvasRenderer: m_ObjectHideFlags: 0 @@ -243,6 +243,11 @@ PrefabInstance: propertyPath: m_AnchorMax.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 4465912299598443116, guid: c289b39ffe932df4aaada93055e1bcea, + type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 4465912300404621520, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_Name @@ -271,7 +276,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_AnchorMax.y - value: 1 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} @@ -281,17 +286,17 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 0.5 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_SizeDelta.x - value: 400 + value: 430 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_SizeDelta.y - value: 0 + value: 830 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} @@ -331,7 +336,7 @@ PrefabInstance: - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} propertyPath: m_AnchoredPosition.x - value: -200 + value: -215 objectReference: {fileID: 0} - target: {fileID: 4465912300404621521, guid: c289b39ffe932df4aaada93055e1bcea, type: 3} diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/05_ChatRoom.unity b/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/05_ChatRoom.unity index ab8dc9e..3cb3a9d 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/05_ChatRoom.unity +++ b/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/05_ChatRoom.unity @@ -184,10 +184,10 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 + m_FontSize: 20 m_FontStyle: 2 m_BestFit: 0 - m_MinSize: 10 + m_MinSize: 2 m_MaxSize: 40 m_Alignment: 0 m_AlignByGeometry: 0 @@ -391,7 +391,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -0.000015258789, y: 0} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 30} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1253542825 @@ -469,9 +469,9 @@ RectTransform: m_Father: {fileID: 3610145948686078249} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 200, y: 200} m_SizeDelta: {x: 400, y: 400} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1520469889 @@ -534,10 +534,10 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 + m_FontSize: 20 m_FontStyle: 0 m_BestFit: 0 - m_MinSize: 10 + m_MinSize: 2 m_MaxSize: 40 m_Alignment: 0 m_AlignByGeometry: 0 @@ -593,7 +593,7 @@ RectTransform: m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 0} m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 30} + m_SizeDelta: {x: 0, y: 50} m_Pivot: {x: 0.5, y: 0} --- !u!114 &1644520206 MonoBehaviour: @@ -979,6 +979,7 @@ MonoBehaviour: chatScrollView: {fileID: 3610145948890259162} heightInstrument: {fileID: 1253542825} baseCellHeight: 20 + inputField: {fileID: 1644520206} myName: HowTungTung --- !u!1 &3610145948779590616 GameObject: @@ -1146,8 +1147,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 14.1} - m_SizeDelta: {x: 0, y: -28.182861} + m_AnchoredPosition: {x: 0, y: 35.5} + m_SizeDelta: {x: 0, y: -29} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &3610145948890259162 MonoBehaviour: diff --git a/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/TestGUI_05.cs b/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/TestGUI_05.cs index 09bc778..06c339a 100644 --- a/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/TestGUI_05.cs +++ b/Assets/InfiniteScrollView/Scripts/Samples~/05_ChatRoom/TestGUI_05.cs @@ -8,10 +8,11 @@ public class TestGUI_05 : MonoBehaviour public InfiniteScrollView chatScrollView; public Text heightInstrument; public float baseCellHeight = 20; + public InputField inputField; public string myName = "HowTungTung"; private string speaker = "Tester"; - private string message = "In a recent blog post we introduced the concept of Scriptable Render Pipelines. In short, SRP allow developers to control how Unity renders a frame in C#. We will release two built-in render pipelines with Unity 2018.1: the Lightweight Pipeline and HD Pipeline. In this article we’re going to focus on the Lightweight Pipeline or LWRP."; - + private string message = "In a recent blog post we introduced the concept of Scriptable Render Pipelines. In short, SRP allow developers to control how Unity renders a frame in C#. We will release two built-in render pipelines with Unity 2018.1: the Lightweight Pipeline and HD Pipeline. In this article we’re going to focus on the Lightweight Pipeline or LWRP."; + private async void Awake() { chatScrollView = FindObjectOfType(); @@ -33,7 +34,10 @@ private void OnGUI() public void OnSubmit(string input) { - AddChatData(new ChatCellData(myName, input, true)); + AddChatData(new ChatCellData(myName, input, true)); + this.inputField.text = string.Empty; + this.inputField.ActivateInputField(); + this.inputField.Select(); } private void AddChatData(ChatCellData chatCellData) diff --git a/Assets/InfiniteScrollView/Scripts/package.json b/Assets/InfiniteScrollView/Scripts/package.json index 50e917f..83b3c5a 100644 --- a/Assets/InfiniteScrollView/Scripts/package.json +++ b/Assets/InfiniteScrollView/Scripts/package.json @@ -2,7 +2,7 @@ "name": "com.howtungtung.infinitescrollview", "displayName": "InfiniteScrollView with UniTask", "description": "InfiniteScrollView is made for Unity extension, that support use as less as possible gameObject count to achieve large infinite scrolling content. Developed by native UGUI system, no any magical code inside, so you can easily modify and extend by yourself.", - "version": "1.3.0", + "version": "1.3.1", "unity": "2021.3", "license": "MIT", "samples": [ diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 2440450..7b3086e 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -6,34 +6,34 @@ EditorUserSettings: serializedVersion: 4 m_ConfigSettings: RecentlyUsedSceneGuid-0: - value: 5252515f5353085909580e2713760e4443151e7f7b2e23627d7a4a37b4e46561 + value: 010157505051510a5e565f7240775c4114151d7e792b7e68782a4865b0e6356e flags: 0 RecentlyUsedSceneGuid-1: - value: 010157505051510a5e565f7240775c4114151d7e792b7e68782a4865b0e6356e + value: 52020303030c5d58585a097a48775e1344164d78282a27692e7b4831b3b7666f flags: 0 RecentlyUsedSceneGuid-2: - value: 52020303030c5d58585a097a48775e1344164d78282a27692e7b4831b3b7666f + value: 5b015055040d0f095d5c547012210f44434f40722e7e25362e704f60bab7616b flags: 0 RecentlyUsedSceneGuid-3: - value: 5b015055040d0f095d5c547012210f44434f40722e7e25362e704f60bab7616b + value: 570252035d015b095c0b0a7643775c1546151e2f7f7b74367f284464e0b2313d flags: 0 RecentlyUsedSceneGuid-4: value: 0053035606035a5e555e5d7716250e44151540297e7a2065757c4464b4e46169 flags: 0 RecentlyUsedSceneGuid-5: - value: 5a5501055602500859085e77167a0d44404e1c7b7e7a2433297c1e37b2e1616e + value: 020906515053580a080a5d7a47770916154f1a287e7075642b2f1b63e7b86d60 flags: 0 RecentlyUsedSceneGuid-6: - value: 56050d0755055c0d5b5f547445710a4410151a7d7c7a74332f784560b2b43068 + value: 5455070552025c0b5d5d5a7713265e4415164d2c2a2d236378794e64e4e2306c flags: 0 RecentlyUsedSceneGuid-7: - value: 020906515053580a080a5d7a47770916154f1a287e7075642b2f1b63e7b86d60 + value: 5a5501055602500859085e77167a0d44404e1c7b7e7a2433297c1e37b2e1616e flags: 0 RecentlyUsedSceneGuid-8: - value: 5455070552025c0b5d5d5a7713265e4415164d2c2a2d236378794e64e4e2306c + value: 56050d0755055c0d5b5f547445710a4410151a7d7c7a74332f784560b2b43068 flags: 0 RecentlyUsedSceneGuid-9: - value: 570252035d015b095c0b0a7643775c1546151e2f7f7b74367f284464e0b2313d + value: 5252515f5353085909580e2713760e4443151e7f7b2e23627d7a4a37b4e46561 flags: 0 RecentlyUsedScenePath-0: value: 224247031146467e150f01321c264c5f46452702233a2f2a22270932eeaf646addcf39fbee2030322d03e3721130082beb