Author Topic: [SOLVED] two scrollviews position tween problem  (Read 1481 times)

e-tip

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 10
    • View Profile
[SOLVED] two scrollviews position tween problem
« on: July 02, 2014, 08:46:33 AM »
Solved : maybe not the better way but i've created a widget as parent of the two scrollviews and i tween that widget instead of animating the scrollviews
Hi everyone.
I've just bought ngui and i'm in the middle of rebuild the gui of a game i've already made with unity using OnGUI functions.
I'm having a strange issue when tweening Scrollviews.
i've got a uiPanel that contains two scrollviews one on the side of the other.
both scrollviews contains buttons added via code dynamically.

I've added a code that handle the button click that calls this function
  1.        
  2.                 if (!showingSubMaterialMenu) {
  3.                         showingSubMaterialMenu = true;
  4.                         materialScrollView.GetComponentInChildren<TweenPosition>().PlayForward();
  5.                         subMaterialScrollView.GetComponentInChildren<TweenPosition>().PlayForward();
  6.                 } else {
  7.                         showingSubMaterialMenu = false;
  8.                         materialScrollView.GetComponentInChildren<TweenPosition>().PlayReverse();
  9.                         subMaterialScrollView.GetComponentInChildren<TweenPosition>().PlayReverse();
  10.                 }
  11.         }
materialScrollView is the first scrollview and subMaterialScrollView is the second.
if this function is called by the click on the button i get strange scrollview positioning as you can see from this image

For testing purposes i've adedd to OnStart
  1. Invoke("toggleMenuSection",2);Invoke("toggleMenuSection",4);Invoke("toggleMenuSection",6);Invoke("toggleMenuSection",8);

and i can see that the scrollviews moves as i expect.

Does anyone have any suggestions ?

Thank you very much

Edit : after i've investigated a little deeper seems that is something related to the drag of the scroll view and the tween
« Last Edit: July 02, 2014, 11:31:42 AM by e-tip »