1
NGUI 3 Documentation / Re: UIInput
« on: January 06, 2014, 12:31:51 PM »
Thanks. I tried the following line but it caused the following error on Unity.
code:
void Update (){ Debug.Log(UIInput.current.value);}
error:
NullReferenceException: Object reference not set to an instance of an object
myInput.Update () (at Assets/myInput.cs:12)
----
I also tried the following code for onSubmit but it is never called without typing return. I meant it as "before submitting it"
public void valueTest(){Debug.Log(UIInput.current.value);}
----
P.S. I solved my problem by getting the value by the following line instead of UIInput.current.value so it is not problem anymore but I write my solution as FYI.
void Update (){Debug.Log(this.GetComponent<UIInput>().value); }
code:
void Update (){ Debug.Log(UIInput.current.value);}
error:
NullReferenceException: Object reference not set to an instance of an object
myInput.Update () (at Assets/myInput.cs:12)
----
I also tried the following code for onSubmit but it is never called without typing return. I meant it as "before submitting it"
public void valueTest(){Debug.Log(UIInput.current.value);}
----
P.S. I solved my problem by getting the value by the following line instead of UIInput.current.value so it is not problem anymore but I write my solution as FYI.
void Update (){Debug.Log(this.GetComponent<UIInput>().value); }