using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour
{
public Text scoreText;
void Start () {
InvokeRepeating("RunTimer", 1, 1);
}
void RunTimer() {
scoreText.text = (int.Parse(scoreText.text) + 1).ToString();
}
}
void RunTimer() {
if (IsAlive())
scoreText.text = (int.Parse(scoreText.text) + 1).ToString();
}