-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIfStatement
More file actions
43 lines (26 loc) · 743 Bytes
/
IfStatement
File metadata and controls
43 lines (26 loc) · 743 Bytes
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
using UnityEngine;
public class IfStatement : MonoBehaviour {
//floats can hold decimals.
public float numberOne, numberTwo;
// Use this for initialization
void Start () {
//on start
if(numberOne < numberTwo)
{//if numberTwo is greater than numberOne
//do something
//Debug.Log numberTwo
Debug.Log(numberTwo);
}
else if( numberOne > numberTwo)
{//however, if numberOne is greater than numberTwo
//does something
//Debug.Log numberOne
print(numberOne);
}
else
{//otherwise,
//print "They are equal"
print("They are equal");
}
}
}