How would I store the numbers I inputted from my iphone’s keyboard from using the daikon forge’s textbox? On the tutorial video he goes over the textbox for about 1 minute and doesn’t cover it. Ex. On my iphone I click the text box and enter the number 5 . I need the interger 5 stored to a variable. I use c#. Thank you.
You could use databinding to bind the text entered to a variable (covered in one of the tutorials). Or you could just get a reference to the textbox object, and get the data from its text property manually.
Get component?
I haven’t tried this yet, but maybe attach a script to a “submit” button.
-In the button script, make a public variable to hold a reference of the gameobject you want to send the data to. Drag and drop the object from the hierarchy into the variable via the inspector.
public GameObject TargetObj;
private ScriptName TargetScript;
-Use getComponent in the start function to fetch a reference of the script that you are sending the data to.
TargetScript = TargetObj.GetComponent<ScriptName>();
-Then make a public variable to hold a reference of the textbox with the data, and drag and drop the textbox from the hierarchy into this variable via the inspector.
public dfTextbox Tex;
Use the buttons click event to assign the textbox text property to the variable in the target script.
Its click event looks like this:
public void OnClick( dfControl control, dfMouseEventArgs mouseEvent )
{
TargetScript.SomeVariable = int.Parse(Tex.Text);
}
You will want to make sure that the text being sent is of the correct datatype via input validation and conversion.
ok i will try it
couldn’t get it to work.
I have gotten similar functionality to work with this method.
I have th GUI fetching data from an object, updating the object, calling the functions of the object…