diff --git a/src/UI/Panels/InspectorTest.cs b/src/UI/Panels/InspectorTest.cs index b64f160..6f7bfd5 100644 --- a/src/UI/Panels/InspectorTest.cs +++ b/src/UI/Panels/InspectorTest.cs @@ -73,9 +73,8 @@ namespace UnityExplorer.UI.Panels contentHolder.SetActive(false); contentHolder.transform.SetParent(this.content.transform, false); - GameObject.DontDestroyOnLoad(contentHolder); ExplorerCore.Log("Creating dummy objects"); - for (int i = 0; i < 10; i++) + for (int i = 0; i < 150; i++) { dummyContents.Add(CreateDummyContent()); } diff --git a/src/UI/Utility/PanelDragger.cs b/src/UI/Utility/PanelDragger.cs index ae5fb00..f046ecc 100644 --- a/src/UI/Utility/PanelDragger.cs +++ b/src/UI/Utility/PanelDragger.cs @@ -168,13 +168,12 @@ namespace UnityExplorer.UI.Utility { if ((type = GetResizeType(resizePos)) != ResizeTypes.NONE) OnHoverResize(type); + else if (WasHoveringResize) + OnHoverResizeEnd(); handledInstanceThisFrame = true; } else if (WasHoveringResize) - { OnHoverResizeEnd(); - handledInstanceThisFrame = true; - } break; } diff --git a/src/UI/Widgets/ScrollPool/DataHeightCache.cs b/src/UI/Widgets/ScrollPool/DataHeightCache.cs index 5f1c91e..9171f6b 100644 --- a/src/UI/Widgets/ScrollPool/DataHeightCache.cs +++ b/src/UI/Widgets/ScrollPool/DataHeightCache.cs @@ -28,7 +28,6 @@ namespace UnityExplorer.UI.Widgets { this.sisterCache = sisterCache; - ExplorerCore.Log("Creating backup height cache, this count: " + scrollPool.DataSource.ItemCount); TakeFromSister(scrollPool.DataSource.ItemCount); } @@ -79,7 +78,7 @@ namespace UnityExplorer.UI.Widgets public void TakeFromSister(int count) { - for (int i = 0, i < count; i++) + for (int i = 0; i < count; i++) Add(sisterCache[ScrollPool.DataSource.GetRealIndexOfTempIndex(i)]); } diff --git a/src/UI/Widgets/ScrollPool/ScrollPool.cs b/src/UI/Widgets/ScrollPool/ScrollPool.cs index 3e08a03..9e3ad30 100644 --- a/src/UI/Widgets/ScrollPool/ScrollPool.cs +++ b/src/UI/Widgets/ScrollPool/ScrollPool.cs @@ -250,8 +250,6 @@ namespace UnityExplorer.UI.Widgets DisableTempCache(); } - bool ret = false; - CheckDataSourceCountChange(out _); var requiredCoverage = Math.Abs(RecycleViewBounds.y - RecycleViewBounds.x); @@ -259,7 +257,6 @@ namespace UnityExplorer.UI.Widgets int cellsRequired = (int)Math.Ceiling((decimal)(requiredCoverage - currentCoverage) / (decimal)PrototypeHeight); if (cellsRequired > 0 || forceRecreate) { - ret = true; WritingLocked = true; // Disable cells so DataSource can handle its content if need be @@ -285,9 +282,11 @@ namespace UnityExplorer.UI.Widgets SetScrollBounds(); UpdateSliderHandle(true); + + return true; } - return ret; + return false; } // Refresh methods @@ -318,7 +317,6 @@ namespace UnityExplorer.UI.Widgets private bool CheckDataSourceCountChange(out bool shouldJumpToBottom) { - bool ret = false; shouldJumpToBottom = false; int count = DataSource.ItemCount; @@ -340,7 +338,7 @@ namespace UnityExplorer.UI.Widgets return false; } - return ret; + return false; } private void RefreshCells(bool andReloadFromDataSource, bool setSlider) @@ -585,9 +583,6 @@ namespace UnityExplorer.UI.Widgets int poolStartIndex = Math.Max(0, topViewportIndex - (int)(ExtraPoolCells * 0.5f)); poolStartIndex = Math.Min(Math.Max(0, DataSource.ItemCount - CellPool.Count), poolStartIndex); - bottomDataIndex = poolStartIndex + CellPool.Count - 1; - RefreshCells(true, false); - var topStartPos = HeightCache[poolStartIndex].startPosition; float desiredAnchor; @@ -597,7 +592,10 @@ namespace UnityExplorer.UI.Widgets desiredAnchor = desiredMinY - topStartPos; Content.anchoredPosition = new Vector2(0, desiredAnchor); - UpdateSliderHandle(true); + bottomDataIndex = poolStartIndex + CellPool.Count - 1; + RefreshCells(true, false); + + //UpdateSliderHandle(true); } /// Use