Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Nseries on June 11, 2013, 12:26:14 PM

Title: UIInput.selected
Post by: Nseries on June 11, 2013, 12:26:14 PM
Hello, i have some problems with NGUI scripts. The simplest method to show what is, it is to open Example 12 scene. I can use chat, and when I click on any different widget then UIInput, and click on button Enter, the focus(Selected)  don`t set to UIInput. Why?
  1.  void Update()
  2.         {
  3.             if (Input.GetKeyUp(KeyCode.Return))
  4.             {
  5.                 mInput.selected = true;
  6.             }
  7.         }
Why it is dont work after click on different widgets?
Title: Re: UIInput.selected
Post by: ArenMook on June 11, 2013, 01:13:16 PM
You are not checking UICamera.inputHasFocus here, so this code will be triggered even when you are typing -- which is wrong.

Look at how the Chat Example is set up.