Created
March 24, 2018 14:01
-
-
Save KiviMaker/b07b45ff8f99c7fdd26e178f1f15e259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
public class Score : MonoBehaviour { | |
public Text score1; | |
public float score; | |
public bool check = false; | |
// Use this for initialization | |
void Start() | |
{ | |
score1.GetComponent<Text>(); | |
score = 0; | |
} | |
// Update is called once per frame | |
void Update() { | |
if (check == false) | |
{ | |
StartCoroutine(enumerator ()); | |
score1.text = ("Score " + score); | |
Debug.Log(score); | |
Debug.Log(score1); | |
} | |
} | |
IEnumerator enumerator() | |
{ | |
score = score + 0.01f; | |
yield return new WaitForSeconds(0); | |
check = false; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment