public void Update() { if (Input.touchCount > 0) { Touch touch = Input.GetTouch(0); Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position); if (touchPosition.x < 0) { playerMove.SetMoveLeft(true); } else { playerMove.SetMoveLeft(false); } } else { playerMove.StopMoving(); } }
public void OnPointerUp(PointerEventData eventData) { playerMove.StopMoving(); }
public void OnPointerUp(PointerEventData data) { playerJoystick.StopMoving(); }