-
Notifications
You must be signed in to change notification settings - Fork 0
/
Score.cs
45 lines (37 loc) · 832 Bytes
/
Score.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
public class Score : MonoBehaviour {
public static Score ScoreInst;
private Text txt;
public int sco;
void Awake ()
{
txt = GameObject.Find("countscore").GetComponent<Text>();
Instances();
}
void Instances()
{
if (ScoreInst == null)
{
ScoreInst = this;
}
}
public void IncrementScoer()
{
sco++;
txt.text = "" + sco;
if (sco > 0 && sco != 0 && sco < 2)
{
gamemgr.inst.Yes(true);
}
if (sco == 10 && sco < 11)
{
gamemgr.inst.Awesome(true);
}
}
public int GetScore()
{
return this.sco;
}
}