public NavigableUIList(ITypedDataCursor <UIListState> state, Camera camera, Action <int> selectItem) { _isInteractable = state.To(s => s.IsInteractable); _selectItem = selectItem; _highlightedIndex = state.To(s => s.HighlightedIndex); MouseHighlight.Initialize(state); MouseInteraction.LeftMouseClick(state.To(s => s.Items).Get(), selectItem); _controllerHighlight = ControllerHighlight.CreateControllerIndexUpdater( cursor: state, itemSelector: (items, currentIndex, inputDirection) => { return(ControllerHighlight.MoveControllerIndex(camera.WorldToScreenPoint, items, currentIndex, inputDirection)); }); Highlighter.Initialize(state); }
void Awake() { instance = this; }