com.unity.uiextensions.nosa.../Examples/FancyScrollView/04_FocusOn/Example04ScrollViewContext.cs

32 lines
705 B
C#

using System;
namespace UnityEngine.UI.Extensions.Examples
{
public class Example04ScrollViewContext
{
int selectedIndex = -1;
public int SelectedIndex
{
get { return selectedIndex; }
set
{
if (value == selectedIndex)
{
return;
}
selectedIndex = value;
if (OnSelectedIndexChanged != null)
{
OnSelectedIndexChanged(selectedIndex);
}
}
}
public Action<Example04ScrollViewCell> OnPressedCell;
public Action<int> OnSelectedIndexChanged;
}
}