using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Pool; using UnityEngine.Events; using UnityEngine.UI; using XED.Core; using XED.Util; using TMPro; using XED.Manage; namespace XED.Hierarchy { public class PooledScrollView : UnityEngine.MonoBehaviour { private RectTransform content; // Content RectTransform of the ScrollView. private CustomScrollRect scrollRect; // ScrollRect component. private TMP_InputField searchInput; private Button searchCancelButton; private GameObject itemPrefab; // Prefab for scroll items. private UnityEvent onPointerDown; private UnityEvent onDragAndDrop; private ObjectPool pool; // Pool for UI items. private List data = new List(); // The list of hierarchy items. private HierarchyItem root; private List activeItems = new List(); private List selectedItems = new List(); private HierarchyItem lastSelectedItem = null; private float itemHeight; // Height of a single item. private int visibleItemCount; // Number of visible items that fit in the viewport. private int currentIndex = -1; // The index of the first visible item. public UnityEvent> onSelect; public UnityEvent onParentChanged; private void Awake() { content = UtilityFunction.FindDeepChild(transform, "Content").GetComponent(); scrollRect = GetComponent(); searchInput = GetComponentInChildren(); searchCancelButton = UtilityFunction.FindDeepChild(transform, "Button_SearchBar").GetComponent