Teachers open the door but You must enter by yourself.
void Update()
{
if(flying){
var flyingTime=Time.time-launched;
if(flyingTime>3f){
Ready();
}else{
var scale = 1f + magnify*flyingTime;
transform.localScale=new Vector3(scale, scale, scale);
}
}
if(GameObject.Find("/Horse").transform.position.z>1020){
var text=
score==12? "Perfect!\n(12/12)":
score>=9? "Great!\n("+score+ "/12)":
score>=5? "Good Job!\n("+score+"/12)":
"Good Effort!\n("+score+"/12)";
GameObject.Find("Score").GetComponent<TextMeshPro>().text=text.ToString();
}
}
var score=0;
void OnTriggerEnter(Collider other){
if(other.gameObject.tag == "Mato"){
score++;
GameObject.Find("Score").GetComponent<TextMeshPro>().text=score.ToString();
Destroy(other.gameObject);
GetComponent<AudioSource>().Play();//的壊れる音
}
}