// Update is called once per frame void Update() { if (Input.touchCount > 0) { switch (Input.GetTouch(0).phase) { case TouchPhase.Began: scrolling = manualScrolling; break; case TouchPhase.Ended: scrolling = autoScrolling; break; default: break; } } scrolling(); }
// Use this for initialization void Start() { transform.position = new Vector3(0, yStart, 0); scrolling = autoScrolling; }