
Learning C# by Developing Games with Unity 3D Beginner's Guide
By :

Modify
LearningScript
as shown in the next screenshot.
Save the file.
In Unity, click on Play.
Notice line 11 is using the AND operator, and line 16 is using the OR operator.
Here is the output you get in the Unity Console:
Code analysis:
The code on line 8 and its description:
bool theBearMadeBigPottyInTheWoods = true;
A bool
variable is declared and assigned the value of true
.
The code on line 9 with its description:
int temperature = 40;
An int
variable is declared and assigned the value 40
.
The code on line 11 with its description:
if(temperature >= 35 && theBearMadeBigPottyInTheWoods)
An if
statement to test if both conditions are true
.
The first test is checking if the temperature
is greater then, or equal to, 35
.
The value stored in temperature
is 40
, so this condition is true.
The value stored in theBearMadeBigPottyInTheWoods
is true. Therefore the first condition and the second condition...
Change the font size
Change margin width
Change background colour