Welcome,
Guest
. Please
login
or
register
.
April 25, 2026, 10:20:35 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Linking Input to Button
« previous
next »
Print
Pages: [
1
]
Author
Topic: Linking Input to Button (Read 4275 times)
TicTac
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 7
Linking Input to Button
«
on:
October 06, 2013, 08:34:49 AM »
Hello, I'm new to NGUI and Unity in general. I really like what I see with NGUI and I'm trying to sort out profiles for a game I'm developing but I am having problems. Basically what I wan't is for my Inputs from two text boxes to be sent to my create new profile script when a button is pressed. Currently I have a script on each input that reads content of each input, I was then trying to reference them using get component from my create profile but I'm struggling to do so. I feel like I'm missing a trick here!
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: Linking Input to Button
«
Reply #1 on:
October 06, 2013, 10:16:21 PM »
Have a script like this on the button:
public
class
MyHandler
:
MonoBehaviour
{
public
UIInput inputA
;
public
UIInput inputB
;
void
OnClick
(
)
{
Debug
.
Log
(
inputA
.
value
+
", "
+
inputB
.
value
)
;
}
}
Don't forget to drag & drop the values in inspector after attaching this script to your button.
Logged
TicTac
Newbie
Thank You
-Given: 0
-Receive: 0
Posts: 7
Re: Linking Input to Button
«
Reply #2 on:
October 07, 2013, 11:59:29 AM »
Cool, this looks like its working however I think because I am using the free version .value is not working? if so is there a way around it? I plan to update to the full version soon but for now it would be useful to have it working!
Logged
Darkmax
Jr. Member
Thank You
-Given: 2
-Receive: 1
Posts: 93
Re: Linking Input to Button
«
Reply #3 on:
October 07, 2013, 12:35:27 PM »
I think instead of value is text
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
Linking Input to Button