LoopInArray() публичный статический Метод

Loop in an array. (Array)
public static LoopInArray ( int index, Array arr ) : int
index int Index
arr Array Array.
Результат int
Пример #1
0
        /// <summary>
        /// Selection this selection.
        /// </summary>
        /// <param name="selectionIndex"> index to select. </param>
        public void SelectSelection(int selectionIndex, bool hoverCheck = false)
        {
            if (hoverCheck)
            {
                if (JCS_Util.WithInArrayRange(selectionIndex, mSelections))
                {
                    if (mSelections[selectionIndex].Skip)
                    {
                        return;
                    }
                }
            }

            // no need to do anything.
            if (mCurrentSelectIndex == selectionIndex)
            {
                return;
            }

            if (JCS_Util.WithInArrayRange(mCurrentSelectIndex, mSelections))
            {
                // disable current active selection.
                mSelections[mCurrentSelectIndex].Active = false;
            }

            this.mCurrentSelectIndex = selectionIndex;

            this.mCurrentSelectIndex = JCS_Util.LoopInArray(this.mCurrentSelectIndex, mSelections);

            // active the new active selection.
            mSelections[mCurrentSelectIndex].Active = true;

            if (selectionChanged != null)
            {
                selectionChanged.Invoke();
            }
        }