I have a very simple game, I wanted to add a score to it, after that it started to lag a lot, here is my score counter code, I think the problem is in it
using UnityEngine;
using UnityEngine.UI;
public class Score : MonoBehaviour
{
public Text scoreText;
public int scr = 0;
void Update(){
System.Threading.Thread.Sleep(1000);
scr = scr + 1;
scoreText.text = scr.ToString();
}
}