- Home /
Question by
VedSarkar · Aug 31, 2016 at 02:00 PM ·
unity 5event triggering
how to stop Event trigger Update Selected?
I created 2 UI buttons and added Event trigger component with event type Update Selected and assigned the down given methods to them , I want the following codes to run until the buttons are pressed and not longer that but when using Update Selected codes keep on running even after the buttons are released.
public void IncreaseBPM()
{
if (speed < 12)
{
speed += 0.05f;
bpmText.GetComponent<BeatTextControl> ().beats += 1;
PlayerPrefs.SetFloat ("savedBPM", speed);
}
}
public void DecreaseBPM()
{
if (speed > 1.5)
{
speed -= 0.05f;
bpmText.GetComponent<BeatTextControl> ().beats -= 1;
PlayerPrefs.SetFloat ("savedBPM", speed);
}
}
Comment
Your answer