ButtonUI.cs 362 B

123456789101112131415161718
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. public class ButtonUI : MonoBehaviour
  4. {
  5. public Image[] image;
  6. public int nowImage;
  7. public void ChangeImg(int i)
  8. {
  9. image[nowImage].gameObject.SetActive(false);
  10. image[i].gameObject.SetActive(true);
  11. nowImage = i;
  12. }
  13. public void Test()
  14. {
  15. Debug.Log("Test");
  16. }
  17. }