powerfun-unity/Assets/Scripts/UI/Control/PFUIPageButton.cs

29 lines
645 B
C#
Raw Normal View History

2022-05-13 09:28:58 +08:00
using System;
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scripts.UI.Control
{
public class PFUIPageButton : PFUIComponentBase
{
public Text pageIndexText;
public GameObject clickImage;
public int PageIndex { get; set; }
public void SetPageIndex(int pageIndex)
{
PageIndex = pageIndex;
pageIndexText.text = $"{pageIndex + 1}";//pageIndex 从0开始
}
public void ShowLight()
{
clickImage.SetActive(true);
}
public void ShowShadow()
{
clickImage.SetActive(false);
}
}
}