diff --git a/Typo_SsangmunDongB.ttf b/Typo_SsangmunDongB.ttf new file mode 100644 index 0000000..8271554 Binary files /dev/null and b/Typo_SsangmunDongB.ttf differ diff --git a/getScore.cs b/getScore.cs new file mode 100644 index 0000000..6ff9c0a --- /dev/null +++ b/getScore.cs @@ -0,0 +1,38 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class getScore : MonoBehaviour +{ + //식빵 잡으면 true로 바뀌도록 + //왼앞 왼가 왼뒤 오앞 오가 오뒤 + public bool[] breadBool = new[] { false, false, false, false, false, false }; + + //breadBool 에서 true 개수 count할 변수 + int breadCount = 0; + + void Start() + { + + } + + // Update is called once per frame + void Update() + { + if (Input.GetKeyDown(KeyCode.Space)) //누르는 동안 hold + { + + for(int i = 0; i < 6; i++) + { + if (breadBool[i] == true) + breadCount++; + } + transform.localScale = new Vector3(transform.localScale.x * -1, transform.localScale.y, transform.localScale.z); + score.scoreValue+=breadCount; + + + + } + + } +} diff --git a/score.cs b/score.cs new file mode 100644 index 0000000..adfc3f4 --- /dev/null +++ b/score.cs @@ -0,0 +1,23 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + + +public class score : MonoBehaviour +{ + public static int scoreValue = 0; + Text Score; + + void Start() + { + Score = GetComponent(); + + } + + // Update is called once per frame + void Update() + { + Score.text = "Score " + scoreValue; + } +} diff --git a/timer.cs b/timer.cs new file mode 100644 index 0000000..f12bd71 --- /dev/null +++ b/timer.cs @@ -0,0 +1,35 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; + +public class timer : MonoBehaviour +{ + + public GameObject textDisplay; + public int secondsLeft = 59; + public bool takingAway=false; + + void Start() + { + textDisplay.GetComponent().text = "00:" + secondsLeft; + + } + + void Update() + { + if(takingAway==false && secondsLeft > 0) + { + StartCoroutine(TimerTake()); + } + } + + IEnumerator TimerTake() + { + takingAway = true; + yield return new WaitForSeconds(1); + secondsLeft -= 1; + textDisplay.GetComponent().text = "00:" + secondsLeft; + takingAway = false; + } +}