Author Topic: ONGUI() and Update() mixed use  (Read 4026 times)

shokinhan

  • Guest
ONGUI() and Update() mixed use
« on: May 27, 2013, 08:58:29 AM »
Dear all:

When I use OnGUI() and NGUI's Update() mixed,  but the Input Event has error.

I need press double times , then can get the mouse's state is unpressed, the result is wrong!
If I delete the function OnGUI, then I press once , then can get the mouse's state is unpressed, the result is  right!

Why?

Thanks very much!!




ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ONGUI() and Update() mixed use
« Reply #1 on: May 27, 2013, 11:45:07 AM »
I don't know? Don't mix the two? Not sure why you are trying to do this anyway.

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: ONGUI() and Update() mixed use
« Reply #2 on: May 27, 2013, 04:59:01 PM »
Don't use OnGUI.

shokinhan

  • Guest
Re: ONGUI() and Update() mixed use
« Reply #3 on: May 27, 2013, 11:52:34 PM »
I want to use unity's TextField, because it has copy,paste, section and so on!
Then I use the OnGUI and Update mixed. So make this probleam!


shokinhan

  • Guest
Re: ONGUI() and Update() mixed use
« Reply #4 on: May 28, 2013, 12:17:38 AM »
If I use the function OnGUI, it may effect the UICamera's function ProcessMouse ()  ?




shokinhan

  • Guest
Re: ONGUI() and Update() mixed use
« Reply #5 on: May 28, 2013, 04:30:08 AM »
void OnSelect(bool isSelected)
   {
      if (!isSelected)
      {
}
}

void OnGUI()
{
   GUI.TextField("");
}

You see the code. If I add function OnGUI, you need double click for activing the OnSelect.
But If hide the OnGUI, you need click once for activing the OnSelect.
I need GUI.TextField, because I must use NGUI and GUI mixed! 
How to reslove this probleam?


Thanks very much!!!


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ONGUI() and Update() mixed use
« Reply #6 on: May 28, 2013, 03:05:05 PM »
I can't assist you with OnGUI. You have to figure this out yourself.