| 12345678910111213141516171819202122232425262728293031323334353637 |
- using UnityEngine;
- using UnityEngine.UI;
- public class ButtonUI : MonoBehaviour
- {
- public Image[] image;
- public int nowImage;
- public void ChangeImg(int i)
- {
- image[nowImage].gameObject.SetActive(false);
- image[i].gameObject.SetActive(true);
- nowImage = i;
- }
- public void Test()
- {
- Debug.Log("Test");
- }
- public void ShowObj(GameObject obj)
- {
- obj.SetActive(true);
- }
- public void HideObj(GameObject obj)
- {
- obj.SetActive(false);
- }
- public void ShowObjOrNot(GameObject obj)
- {
- if (obj.activeSelf)
- {
- obj.SetActive(false);
- }
- else
- {
- obj.SetActive(true);
- }
- }
- }
|