2025-05-02 09:27:08 +09:00

30 lines
711 B
C#

using UnityEngine;
using System.Collections;
public class Swapper1 : MonoBehaviour
{
public GameObject[] character;
public int index;
public Texture btn_tex;
void Awake()
{
foreach (GameObject c in character)
{
c.SetActive(false);
}
character[0].SetActive(true);
}
void OnGUI()
{
if (GUI.Button(new Rect(Screen.width - 70,0, 70, 70), btn_tex))
{
character[index].SetActive(false);
index++;
index %= character.Length;
character[index].SetActive(true);
}
}
}