Search Unity

Scrolling programmatically

Discussion in 'UGUI & TextMesh Pro' started by saarwii, Oct 10, 2015.

  1. saarwii

    saarwii

    Joined:
    Mar 7, 2014
    Posts:
    24
    I am looking for a way to scroll a scroll rect programmatically. For example i want to touch anyway on a touch screen and swipe left or right, But the user is not going to be touching the scroll rect or buttons directly.
    In my case the scoll is going to act like a spinning wheel so the scroll isnt going to follow the position of the finger, more scroll given the pase and length of a swipe.

    I can select objects through code
    Code (CSharp):
    1.  eventSystem.SetSelectedGameObject (button[buttonPos].gameObject, new BaseEventData (eventSystem));
    Can i use the selected object some how? or can i call the some function in the event system and do it that way?
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860