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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -