Class ScrollRectOptimizer
- Namespace
- Fallencake.UI
- Assembly
- Fallencake.UI.dll
Optimizes ScrollRect performance by culling invisible items outside the viewport. Automatically activates/deactivates child elements based on their visibility in the view rectangle.
[RequireComponent(typeof(ScrollRect))]
public class ScrollRectOptimizer : MonoBehaviour
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourScrollRectOptimizer
Methods
AddChild(RectTransform)
Add a child element to the optimization list
public void AddChild(RectTransform child)
Parameters
childRectTransformRectTransform to add
ForceUpdateVisibility()
Force immediate update of all children visibility
public void ForceUpdateVisibility()
RefreshChildren()
Manually refresh the children list and reinitialize optimizer
public void RefreshChildren()
RemoveChild(RectTransform)
Remove a child element from the optimization list
public void RemoveChild(RectTransform child)
Parameters
childRectTransformRectTransform to remove