Пример #1
0
        /// <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;
        }
 private void AssignReferences()
 {
     _listBank = GetComponent <BaseListBank>();
     if (_listBoxes == null)
     {
         _listBoxes = new List <ListBox>();
     }
     else
     {
         _listBoxes.Clear();
     }
     foreach (Transform child in transform)
     {
         var listBox = child.GetComponent <ListBox>();
         if (listBox)
         {
             _listBoxes.Add(listBox);
         }
     }
 }