How can I convert value of textMesh.text to int?
int someInt = int.Parse(textMesh.text);
Check this for details :