Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Typo_SsangmunDongB.ttf
Binary file not shown.
38 changes: 38 additions & 0 deletions getScore.cs
Original file line number Diff line number Diff line change
@@ -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;



}

}
}
23 changes: 23 additions & 0 deletions score.cs
Original file line number Diff line number Diff line change
@@ -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<Text>();

}

// Update is called once per frame
void Update()
{
Score.text = "Score " + scoreValue;
}
}
35 changes: 35 additions & 0 deletions timer.cs
Original file line number Diff line number Diff line change
@@ -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>().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>().text = "00:" + secondsLeft;
takingAway = false;
}
}