private void OnEnable() { if (_treeViewState == null) { _treeViewState = new TreeViewState(); } _treeView = new BehaviorTreeNodeModelView(_treeViewState); _searchField = new SearchField(); _searchField.downOrUpArrowKeyPressed += _treeView.SetFocusAndEnsureSelectedItem; }
void InitIfNeeded() { if (!_initialized) { if (_treeViewState == null) { _treeViewState = new TreeViewState(); } _treeView = new BehaviorTreeNodeModelView(_treeViewState); _searchField = new SearchField(); _searchField.downOrUpArrowKeyPressed += _treeView.SetFocusAndEnsureSelectedItem; _initialized = true; } }