public ListPositionCtrl( CircularScrollingListSetting listSetting, RectTransform rectTransform, Camera canvasRefCamera, List <ListBox> listBoxes) { _listSetting = listSetting; _rectTransform = rectTransform; _canvasRefCamera = canvasRefCamera; _listBoxes = listBoxes; _maxNumOfDisabledBoxes = listBoxes.Count / 2; InitializePositionVars(); InitializeInputFunction(); }
/// <summary> /// Manage the list content /// </summary> /// <param name="setting">The settings of the list</param> /// <param name="listBank"> /// The bank containing the contents for list to display /// </param> /// <param name="numOfBoxes">The number of list boxes</param> public ListContentManager( CircularScrollingListSetting setting, BaseListBank listBank, int numOfBoxes) { _listSetting = setting; _listBank = listBank; _numOfBoxes = numOfBoxes; _idFactor = setting.reverseOrder ? -1 : 1; _idHandler = setting.listType == CircularScrollingList.ListType.Circular ? (Func <int, int>)(x => (int)Mathf.Repeat(x, _listBank.GetListLength())) : x => x; }
/// <summary> /// Initialize the box /// </summary> /// <param name="scrollingList">The list which this box belongs to</param> /// <param name="listPositionCtrl">The position controller of this box</param> /// <param name="listContentManager">The content controller</param> /// <param name="listBoxID">The ID of this box</param> public void Initialize( CircularScrollingList scrollingList, ListPositionCtrl listPositionCtrl, ListContentManager listContentManager, int listBoxID) { this.scrollingList = scrollingList; this.listBoxID = listBoxID; _listSetting = scrollingList.setting; _positionCtrl = listPositionCtrl; _contentManager = listContentManager; _listBoxes = scrollingList.listBoxes; InitializePosition(); InitializeBoxDependency(); InitializeContent(); AddClickEvent(); }