Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Update()
- {
- if (Input.touches.Length>0) {
- Touch firstTouch = Input.GetTouch (0);
- if (firstTouch.phase == TouchPhase.Began) {
- if (firstTouch.position.x > ScreenCenterX) {
- sagHareketBasili ();//Move Right
- }
- if (firstTouch.position.x < ScreenCenterX) {
- solHareketBasili ();//Move Left
- }
- } else
- sagHareketBasiliDegil ();//Stop
- solHareketBasiliDegil ();//Stop
- }
- }
- }
- void Update()
- {
- if (Input.touches.Length>0) {
- if (!EventSystem.current.IsPointerOverGameObject ()) {
- Touch firstTouch = Input.GetTouch (0);
- if (firstTouch.phase == TouchPhase.Began) {
- if (firstTouch.position.x > ScreenCenterX) {
- sagHareketBasili ();
- }
- if (firstTouch.position.x < ScreenCenterX) {
- solHareketBasili ();
- }
- } else if (firstTouch.phase == TouchPhase.Ended) {
- sagHareketBasiliDegil ();
- solHareketBasiliDegil ();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement