Author Topic: Switch menus effectively  (Read 6749 times)

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Switch menus effectively
« on: May 29, 2012, 09:35:02 AM »
Hi there i feel like a dumbass i just cant get my menus to switch between each other. I have 3 menus at the start of my game Login, Select Server, then MainMenu i want to switch between them when buttons are clicked. I created all of the menus as separate game objects and just saved them as prefabs but i don't think this will work. i now have my sign in menu which should switch to the select server. I have tried SetActive enabling my next menu then disabling the current one. But how exactly so you guys do this with your menus. All i need is for my menus to just switch but i am having a hell of a time doing this.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch menus effectively
« Reply #1 on: May 29, 2012, 02:13:52 PM »
I'm also not sure what difficulty you're having SetActive(true) one, SetActive(false) the other.

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Switch menus effectively
« Reply #2 on: May 29, 2012, 06:15:23 PM »
Well i set up my menus at first as seperate game objects i then started to code in what i wanted the button to do when clicked(Obviously) so for my code i had 2 public gameobjects one for the current menu and one for the next menu. I then used NGUITools.SetActive to enable and disable these game objects the thing is it disables the current menu but does not enable the next menu. I am enabling the next menu first the disabling the currentMenu.

I dont know how else you could swap between menus. If you could post some sort of video or some links to methods that would be great.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch menus effectively
« Reply #3 on: May 29, 2012, 06:54:49 PM »
Well, as I mentioned, it works fine here when I try it. Double-check your target game object for your SetActive call. Make sure it's what you think it is.

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Switch menus effectively
« Reply #4 on: May 30, 2012, 04:01:27 AM »
Well should i create separate panels for each menu that i need.

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Switch menus effectively
« Reply #5 on: May 30, 2012, 09:31:39 AM »
I just don't know how you have it set up

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch menus effectively
« Reply #6 on: May 30, 2012, 01:05:56 PM »
Each window (also each tabbed element, etc) should use its own panel, yes.

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Switch menus effectively
« Reply #7 on: May 30, 2012, 04:49:52 PM »
Ah ok i was setting up whole new UIs for it

johnessy

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 29
    • View Profile
Re: Switch menus effectively
« Reply #8 on: May 30, 2012, 05:04:51 PM »
Ok so i set up a basic menu with a button when the button is clicked enable our next menu and then disable the current one it just does not work. I know i am setting this up wrong please help me as this is an amazing piece of kit. Download the project here link removed.
« Last Edit: May 31, 2012, 01:42:16 AM by ArenMook »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Switch menus effectively
« Reply #9 on: May 31, 2012, 01:43:06 AM »
Posting NGUI's source code in public instead of emailing me a private download link is the quickest way to get banned from support.