1
NGUI 3 Support / UIInput OnReturnKey
« 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:
Needless to say, it doesn't. How is this system supposed to be used? Any help is much appreciated...
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...
