FormatException: Input string was not in the correct format
System.Int32.Parse (System.String s) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Int32.cs:629)
Here is my code;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PuzzleSelectController : MonoBehaviour {
public void SelectPuzzle()
{
string[] name = UnityEngine.EventSystems.EventSystem.current.currentSelectedGameObject.name.Split();
int index = int.Parse (name [1]);
Debug.Log("Number " + index);
// Application.LoadLevel("Gameplay");
}
public void BackToMainMenu()
{
Application.LoadLevel ("MainMenu");
}
}
A lot of thanks to anyone. Fairly new to this situation.
↧