Страница 1 из 1
Input string was not in the correct format
Добавлено:
11 авг 2020, 18:57
NOVA
Здравствуйте. Чот не хотит integer в text.
Просто с объектом text работает а в inputfield не хочет.
public InputField StartFrame;
StartFrame.text = CurrentCamera.GetComponent<CameraScript>().StartFrame.ToString();
Content type integer number. Может поэтому?
Как правильно?
Re: Input string was not in the correct format
Добавлено:
11 авг 2020, 20:06
Iq51
Всё должно работать. CurrentCamera.GetComponent<CameraScript>().StartFrame - тут точно int ?
Re: Input string was not in the correct format
Добавлено:
11 авг 2020, 20:15
NOVA
Iq51 писал(а):Всё должно работать. CurrentCamera.GetComponent<CameraScript>().StartFrame - тут точно int ?
public int StartFrame = 0;
public int EndFrame = 0;
точно. Я думаю всё таки content type integer number
Re: Input string was not in the correct format
Добавлено:
11 авг 2020, 20:36
seaman
Что за тип InputField?
Вы работаете с UIElements?
Re: Input string was not in the correct format
Добавлено:
12 авг 2020, 05:04
NOVA
seaman писал(а):Что за тип InputField?
Вы работаете с UIElements?
Да.
Сделал так.
Используется csharp
string SF = CurrentCamera.GetComponent<CameraScript>().StartFrame.ToString();
Debug.Log(SF);
StartFrame.text = SF;
Ошибка вылазит именно в этой строке.
Debug.Log верный.
StartFrame.text = SF;
Re: Input string was not in the correct format
Добавлено:
12 авг 2020, 05:48
NOVA
Всё разобрался. Изменение текста вызывало неверный метод, настроенный в редакторе.