1234567891011121314151617181920212223 |
- using System.Collections.Generic;
- using UnityEngine;
- using System.Collections;
- public class UISwitchImageTutor : MonoBehaviour
- {
- public List<Texture> Textures;
- public UITexture Texture;
- private int index = 0;
- void OnClick()
- {
- Texture.mainTexture = Textures[index];
- if (index == Textures.Count-1)
- {
- index = 0;
- }
- else
- {
- index++;
- }
- }
- }
|