System.Collections.Generic.List.IndexOf(TypePickerItemBehaviour)

Here are the examples of the csharp api System.Collections.Generic.List.IndexOf(TypePickerItemBehaviour) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : TypePickerBehaviour.cs
with GNU General Public License v3.0
from voidALPHA

private void EnsureHoveredItemIsVisible()
        {
            if ( HoveredItem == null )
                return;

            var visibleItems = Items.Where( i => i.Visible ).ToList();
            var hoveredItemIndex = visibleItems.IndexOf( HoveredItem );
            var visibleChildCount = visibleItems.Count;

            var normalizePosition = (hoveredItemIndex) / (float)(visibleChildCount - 1);
            
            //Debug.LogFormat( "{0}/{1} is {2}", hoveredItemIndex, visibleChildCount, normalizePosition );

            SetScrollRectPosition( normalizePosition );
            this.ExecuteAtEndOfFrame( () => SetScrollRectPosition( normalizePosition ) );
        }