Esempio n. 1
0
        /// <summary>
        /// Swap the least position to normalized most position + 1.0
        /// </summary>
        /// <param name="least">Least valued CarouselItem</param>
        /// <param name="most">Most valued CarouselItem</param>
        /// <param name="newLeast">The new least valued CarouselItem</param>
        void LeastToMost(CarouselItem least, CarouselItem most, CarouselItem newLeast)
        {
            least.UpdateScore(most.CalculateScore() + most.SizeTop + most.Padding + least.SizeBottom + least.Padding);

            if (OnLeastToMost != null)
            {
                OnLeastToMost(newLeast.gameObject, least.gameObject);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Swap the most position to normalized least position - 1.0
        /// </summary>
        /// <param name="least">Least valued CarouselItem</param>
        /// <param name="most">Most valued CarouselItem</param>
        /// <param name="newMost">The new most valued CarouselItem</param>
        void MostToLeast(CarouselItem least, CarouselItem most, CarouselItem newMost)
        {
            most.UpdateScore(least.CalculateScore() - least.SizeBottom - least.Padding - most.SizeTop - most.Padding);

            if (OnMostToLeast != null)
            {
                OnMostToLeast(most.gameObject, newMost.gameObject);
            }
        }