Welcome,
Guest
. Please
login
or
register
.
April 29, 2026, 12:49:11 PM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Selecting UIInput via code
« previous
next »
Print
Pages: [
1
]
Author
Topic: Selecting UIInput via code (Read 2347 times)
Groszq
Guest
Selecting UIInput via code
«
on:
June 21, 2013, 01:14:00 AM »
Hi there!
I need to activate UIInput via code to make a system of Private Message, Offer trade and etc. in the game, which Im woking on. Is there any possibility to create something like that?
I use UIInput.selected property, but it still doesn't work properly.
selectedChannel
.
transform
.
FindChild
(
"InputField"
)
.
GetComponent
<
UIInput
>
(
)
.
label
.
text
=
"/whisper "
+
playerName
+
" "
;
selectedChannel
.
transform
.
FindChild
(
"InputField"
)
.
GetComponent
<
UIInput
>
(
)
.
selected
=
true
;
Thanks in advance!
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Selecting UIInput via code
«
Reply #1 on:
June 21, 2013, 02:53:45 AM »
1. Never use Find. Bad practice, slow, and is based on name -- something that you can easily change without thinking.
2. Look at the chat example that comes with NGUI. Pressing Enter activates input there.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Selecting UIInput via code