Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: EvilWolve on June 25, 2014, 09:47:54 AM
Title:
UIInput OnReturnKey
Post by:
EvilWolve
on
June 25, 2014, 09:47:54 AM
Hello,
I'm very new to the whole Delegate concept. I don't get how to achieve this:
I have a UIInput field. When the user presses the NewLine-key, the text field is supposed to submit its contents.
So this is how I think it should work:
public
UIInput input
;
void
Start
(
)
{
input
.
onReturnKey
=
SubmitMessage
(
)
;
}
private
UIInput
.
OnReturnKey
SubmitMessage
(
)
{
input
.
Submit
(
)
;
return
UIInput
.
OnReturnKey
.
NewLine
;
}
Needless to say, it doesn't. How is this system supposed to be used? Any help is much appreciated...
Title:
Re: UIInput OnReturnKey
Post by:
ArenMook
on
June 26, 2014, 09:29:19 AM
EventDelegate.Add or EventDelegate.Set
EventDelegate
.
Set
(
input
.
onSubmit
, YourFunction
)
;
void
YourFunction
(
)
{
Debug
.
Log
(
UIInput
.
current
.
value
;
}