void Update()
{
UpdateSelPageIcon();
}
/// <summary>
/// 通过滚动窗口的位置来判断显示第几个页面
/// 当前窗口位置X取绝对值/ 每个Grid下窗口宽度 再用这个值来判断几页
/// Girds = 滑动的页面grid
/// APageGridObjs = 页面的数组
/// PageGridObjs = 页签的数组
/// </summary>
private void UpdateSelPageIcon()
{
UICenterOnChild m_uicenter = Girds.gameObject.GetComponent<UICenterOnChild>();
for (int index = 0; index <= APageGridObjs.Count - 1; index++)
{
if (APageGridObjs[index] == m_uicenter.centeredObject)
{
for (int i = 0; i < PageGridObjs.Count; i++)
{
PageGridObjs[i].gameObject.transform.FindChild("bg").gameObject.SetActive(false);
}
PageGridObjs[index].gameObject.transform.FindChild("bg").gameObject.SetActive(true);
}
}
}