Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class ButtonDown : MonoBehaviour {
  5. public GameObject button;
  6. public float speed = 0.0f;
  7. public int movement = 0;
  8. public PlaySound2 z;
  9. void OnMouseDown()
  10. {
  11. button.transform.position -= button.transform.up * speed * movement;
  12. z.a16 = true;
  13. Debug.Log("Down");
  14. }
  15. void OnMouseUp()
  16. {
  17. button.transform.position += button.transform.up * speed * movement;
  18. Debug.Log("Up");
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement