Skip to content

Instantly share code, notes, and snippets.

@kamera25
Created January 29, 2015 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamera25/5aa889e62bf7f7ca8c43 to your computer and use it in GitHub Desktop.
Save kamera25/5aa889e62bf7f7ca8c43 to your computer and use it in GitHub Desktop.
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