FormatException: Input string was not in a correct format.
System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Int32.Parse (System.String s) (at <437ba245d8404784b9fbab9b439ac908>:0)
R_Main.Update () (at Assets/Random/R_Main.cs:24)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class R_Main : MonoBehaviour
{
public InputField inf_ot;
public InputField inf_do;
public Text otvet;
public int str;
public int str2;
public int otv;
public void Random()
{
str += str2 = otv;
}
// Update is called once per frame
void Update()
{
str = int.Parse(inf_ot.text);
str2= int.Parse(inf_do.text);
otvet.text = "Число: " + otv.ToString();
}
}
str = int.Parse(inf_ot.text);
str2= int.Parse(inf_do.text);
public void Random()
{
str += str2 = otv; // Не будет работать, либо будет работать не так, как вам нужно.
}