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 OnPressedCell; public Action OnSelectedIndexChanged; } }