Advertisement
Guest User

Untitled

a guest
Sep 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. void Update()
  2. {
  3. if (Input.touches.Length>0) {
  4. Touch firstTouch = Input.GetTouch (0);
  5. if (firstTouch.phase == TouchPhase.Began) {
  6. if (firstTouch.position.x > ScreenCenterX) {
  7. sagHareketBasili ();//Move Right
  8. }
  9. if (firstTouch.position.x < ScreenCenterX) {
  10. solHareketBasili ();//Move Left
  11. }
  12. } else
  13. sagHareketBasiliDegil ();//Stop
  14. solHareketBasiliDegil ();//Stop
  15. }
  16. }
  17. }
  18.  
  19. void Update()
  20. {
  21. if (Input.touches.Length>0) {
  22. if (!EventSystem.current.IsPointerOverGameObject ()) {
  23. Touch firstTouch = Input.GetTouch (0);
  24. if (firstTouch.phase == TouchPhase.Began) {
  25. if (firstTouch.position.x > ScreenCenterX) {
  26. sagHareketBasili ();
  27. }
  28. if (firstTouch.position.x < ScreenCenterX) {
  29. solHareketBasili ();
  30. }
  31. } else if (firstTouch.phase == TouchPhase.Ended) {
  32. sagHareketBasiliDegil ();
  33. solHareketBasiliDegil ();
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement