get int from inputfield unity code example
Example 1: unity text display int
public Text text;
public int num;
void Update ()
{
text.text = num.ToString();
}
//Make sure to set the text variable to a UI text inside Unity
//or run GetComponent<>() in the Start() or Awake() functions
Example 2: unity cast int to float
//(float) casts float or int after it to an float
intVar = (float)var