c# - Hold down button unity3d -
i trying build button changes game speed when being pressed , changes when stops being pressed.
to make wrote functions:
public void onpointerdown() { mousedown = true; background1.sprite = on; time.timescale = 2; } public void onpointerup() { time.timescale = 1; mousedown = false; background1.sprite = off; }
they connected button. when button pressed game speed changes, never changes (it should happen when stop holding button).
know how fix this?
Comments
Post a Comment