-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy patheatcomplete.cs
More file actions
53 lines (45 loc) · 1.47 KB
/
eatcomplete.cs
File metadata and controls
53 lines (45 loc) · 1.47 KB
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
46
47
48
49
50
51
52
53
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class eatcomplete : MonoBehaviour
{
public GameObject cubet;
public GameObject cubef;
public GameObject food1;
public GameObject food2;
public GameObject food3;
public GameObject food4;
public GameObject food5;
public GameObject food6;
Audio2 Aud2;
Audio2 Audio3;
void Start()
{
Aud2 = GameObject.Find("cubet").GetComponent<Audio2>();
Audio3 = GameObject.Find("cubef").GetComponent<Audio2>();
}
void Update()
{
}
public void check()
{
Debug.Log(food1.gameObject.activeSelf);
Debug.Log(food2.gameObject.activeSelf);
Debug.Log(food3.gameObject.activeSelf);
Debug.Log(food4.gameObject.activeSelf);
Debug.Log(food5.gameObject.activeSelf);
Debug.Log(food6.gameObject.activeSelf);
if (food1.gameObject.activeSelf == false && food2.gameObject.activeSelf == false&&
food3.gameObject.activeSelf == false && food4.gameObject.activeSelf == false&&
food5.gameObject.activeSelf == false && food6.gameObject.activeSelf == false)
{
Debug.Log(food1.gameObject.activeSelf);
Aud2.playAudio();
}
else
{
Scoring.totalScore += 5; //다 안먹었을때 환경오염도 점수 올라감
Audio3.playAudio();
}
}
}