public void EntryChangedContent(RouletteEntry entry, int prevContentId, int contentId)
 {
     if (rouletteType != RouletteType.Linear)
     {
         return;
     }
     ContentInEntries.Remove(prevContentId);
     ContentInEntries.Add(contentId, entry);
 }
        /// <summary>
        /// Get the object of the centered RouletteEntry.
        /// The centered RouletteEntry is found by comparing which one is the closest
        /// to the center.
        /// </summary>
        public RouletteEntry GetCenteredEntry()
        {
            var           minPosition = Mathf.Infinity;
            float         position;
            RouletteEntry candidateEntry = null;

            switch (direction)
            {
            case Direction.Vertical:
                foreach (RouletteEntry rouletteEntry in rouletteEntries)
                {
                    position = Mathf.Abs(rouletteEntry.transform.localPosition.y);
                    if (position < minPosition)
                    {
                        minPosition    = position;
                        candidateEntry = rouletteEntry;
                    }
                }
                break;

            case Direction.Horizontal:
                foreach (RouletteEntry rouletteEntry in rouletteEntries)
                {
                    position = Mathf.Abs(rouletteEntry.transform.localPosition.x);
                    if (position < minPosition)
                    {
                        minPosition    = position;
                        candidateEntry = rouletteEntry;
                    }
                }
                break;

            case Direction.Radial:
                foreach (var rouletteEntry in rouletteEntries)
                {
                    position = Mathf.Abs(Mathf.DeltaAngle(angleStart, rouletteEntry.AnglePos));

                    if (position < minPosition)
                    {
                        minPosition    = position;
                        candidateEntry = rouletteEntry;
                    }
                }
                break;
            }

            return(candidateEntry);
        }