forked from aparnavadlamani/fiXit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLevel1.cs
More file actions
112 lines (111 loc) · 2.58 KB
/
Level1.cs
File metadata and controls
112 lines (111 loc) · 2.58 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class Level1 : MonoBehaviour
{
int flag1 = 0;
int flag2 = 0;
int score = 100;
public GameObject panel;
public GameObject panel1;
public GameObject image1;
public GameObject image2;
public InputField input1;
public InputField input2;
public GameObject imagebulb1;
public GameObject imagebulb2;
public GameObject PlayB;
public GameObject panel2;
public GameObject panel3;
public Text scorey;
int buttonindex;
public void Button1()
{
panel.SetActive(true);
buttonindex = 1;
flag1 = 1;
}
public void Button2()
{
panel.SetActive(true);
buttonindex = 2;
flag2 = 1;
}
public void closePanel(int index)
{
if(index==0)
panel3.SetActive(false);
if (index == 1)
panel.SetActive(false);
}
public void xorButton()
{
if(buttonindex==1)
{
image1.SetActive(true);
}
else
{
score -= 2;
}
}
public void IUnderstoodButton()
{
if(flag1==1&&flag2==1)
{
panel2.SetActive(true);
scorey.text = score + "";
}
}
public void selectLevelButton()
{
panel2.SetActive(false);
SceneManager.LoadScene(1);
}
public void andButton()
{
if(buttonindex==2)
{
image2.SetActive(true);
}
else
{
score -= 2;
}
}
public void nextButton()
{
panel1.SetActive(false);
panel3.SetActive(true);
}
public void DoneButton()
{
if(flag1==1&&flag2==1)
PlayB.SetActive(true);
}
public void PlayButton()
{
if(input1.text=="0"&&input2.text=="1")
{
imagebulb1.SetActive(true);
imagebulb2.SetActive(false);
}
if (input1.text == "1" && input2.text == "0")
{
imagebulb1.SetActive(true);
imagebulb2.SetActive(false);
}
if (input1.text == "0" && input2.text == "0")
{
imagebulb1.SetActive(false);
imagebulb2.SetActive(false);
}
if (input1.text == "1" && input2.text == "1")
{
imagebulb1.SetActive(false);
imagebulb2.SetActive(true);
}
}
}