Author Topic: 3 sliding panels configured same way(UIDrag), only 1 reset when SpringPanel.Beg  (Read 6918 times)

BooBi

  • Guest
Hi,

I've got 3 Sliding panels set up the same way as the Scroll view panel example.
- Anchor
  -UIPanel w/ UIDraggable script
    -UIGrid with the UIGrid script off and the UICenterOnChild
    - 11 children.

on the script UIDraggable I've added a public static bool that triggers a function that launch the SpringPanel.Begin()

To set up my panels, I've created one and duplicated it 2 times...
First of all my SpringPanel component is only added on two of my panels automatically when I start the game,  the third one appears only when I actually drag the children...
on click on a button, i turn on the static bool to ask for a reset, on a fresh start, it only works for one panel(A), the two others(B)(C) don t work until I did it on the first one(A)... No clue why it interacts like that...


Any ideas

I'll add more info, as I discover them...


EDIT:
Now it seems that it s not necessarily the panel A that needs to be reset first in order to have the others working too, it did it with the B (A & C weren t working... B did), I don't get it...
« Last Edit: March 04, 2013, 11:51:48 AM by BooBi »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I am not sure what it is you're trying to do with 3 panels, or why you had to modify NGUI's code adding some static variable...

BooBi

  • Guest
My app is composed of:
- Main screen menu
- booklet 1 (11pages)
- booklet 2 (11pages)
- booklet 3 (11pages)
- Contact page
- "About this App" page

When you start my app, you are on the main menu, which include 3 main buttons.
On the right side of my screen (outside the view), I've got 3 panels (all three are Scroll view panels with children (booklet 1,2&3).
On the left side of my screen (outside the view), I'Ve got two panels (not sliding ones, Contact&About pages)
On click on one of the three buttons, I start few animations, one that make the main menu (buttons and center img) leave the screen to the left) and another one that bring the panel (that corresponds to the button pressed) from the right side of the screen to the main view.
Once the panel opened, the user can flick through the different pages of the panel (each page is a child, and you flick through as with the desktop view of the IOS devices).
On each buttons of my app I've added a script that detect the onclick and send the ID(int) of the button pressed to a Button manager script (that ive done) like that I've centralised all the buttons actions in one script.
On the opened panel page, when the Back button is pressed I need to animate the whole thing in the other way (bring back the menu and push out the sliding panel). But at that time I what to reset the children position, that way when the user goes back to that section of the app, well he starts again from the first page(child).
All the animations are done in unity, and I'm using static bools to interact between scripts.


Here is a webplayer version of the app I've done this week (related in all my posts & topics):
https://dl.dropbox.com/u/102815925/SwanseaUniApp/WebPlayer.html
« Last Edit: March 05, 2013, 09:39:14 AM by BooBi »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I can't run your web demo. I don't know what version of Unity you built it with, but it just redirects to the download link.