Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UGUIでRepeatButtonを作る。
using UnityEngine;
using System.Collections;
public class RepeatButton : MonoBehaviour
{
bool push = false; // ボタンが押されているか?
public void StartPush()
{
push = true;
}
public void StopPush()
{
push = false;
}
void Update()
{
if(push)
{
//ここにやらせたい処理を書きます
Debug.Log("押されてます!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment