Author Topic: UIInput problem.  (Read 2337 times)

slway07

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 7
    • View Profile
UIInput problem.
« on: October 18, 2013, 12:53:39 AM »
I try using UIInput widget.
I have two problems.
One is I can't reset the text when I pressed Enter.
Second is I can't set the UIInput focused when I pressed Enter. Here's my code.

With my experience When I press Enter Key on UIInput widget, it loses focus.

  1. // This is event receiver class.
  2. public GameObject m_pUIInput;   // UIInput Widget object
  3. void EventSubmit()  // OnSubmit
  4. {
  5. print("OnSubmit!!");
  6.   m_pUIInput.GetComponent<UIInput>().label.text = "";
  7.   m_pUIInput.GetComponent<UIInput>().selected = true;
  8. }
  9.  

What am I doing wrong?? Help me out.
Thanks.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIInput problem.
« Reply #1 on: October 18, 2013, 05:58:58 PM »
Did you not see the chat window example? It does both of these.