private void OnTextChanged(ChangeEvent <string> changeEv) { var filteredItems = OTGEditorUtility.AvailableAnimationClips.Where(x => x.ToLower().Contains(changeEv.newValue.ToLower())).ToList(); OTGEditorUtility.AvailableAnimationClipsFilteredList.Clear(); OTGEditorUtility.AvailableAnimationClipsFilteredList.AddRange(filteredItems); OTGEditorUtility.PopulateListView <string>(ref m_animationListView, ref m_containerElement, OTGEditorUtility.AvailableAnimationClipsFilteredList, "animation-list-area", true); }
protected override void HandleOnViewFocused() { CleanupGraph(); CreateNewGraph(); LinkControls(); HideCopyPasteButton(); OTGEditorUtility.PopulateListViewScriptableObject <OTGCombatAction>(ref m_actionListView, ref m_containerElement, OTGEditorUtility.ActionsInstantiated, "action-list-area"); OTGEditorUtility.PopulateListViewScriptableObject <OTGTransitionDecision>(ref m_transitionListView, ref m_containerElement, OTGEditorUtility.TransitionsInstantiated, "transition-list-area"); OTGEditorUtility.PopulateListView <string>(ref m_animationListView, ref m_containerElement, OTGEditorUtility.AvailableAnimationClips, "animation-list-area", true); AddCallbacksToListView(ref m_actionListView); AddCallbacksToListView(ref m_transitionListView); AddCallbacksToListView(ref m_animationListView); m_actionListView.onSelectionChange += OnActionListItemSelected; m_transitionListView.onSelectionChange += OnActionListItemSelected; m_animationListView.onSelectionChange += OnAnimationListItemSelected; SubscribeToButtonCallbacks(); m_animFilterField.RegisterValueChangedCallback(OnTextChanged); }