Answer the question
In order to leave comments, you need to log in
How to convert a string to a number in Unity?
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI; // для работы с UI
using UnityEngine;
public class button : MonoBehaviour
{
public int mega_number = 0;
public GameObject guiTextLink; //Ссылка на объект, если скрипт не на нем
// Start is called before the first frame update
void Start(){
}
// Update is called once per frame
void Update(){
mega_number++;
print(mega_number);
guiTextLink.GetComponent<Text>().text = mega_number;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question