- Learning C# 7 By Developing Games with Unity 2017(Third Edition)
- Micael DaGra?a Greg Lukosek
- 92字
- 2021-07-02 19:59:39
Using the NOT operator to change the condition
Here's a little curveball to wrap your mind around: the NOT logical operator. It's written in code using an exclamation mark. This makes a true condition false, or a false condition true. Let's add a NOT operator to our statement. Line 10 should now look like this:
if ( ! willItBeRainingToday ) {
Press Play in the editor. You will notice that the decision?1;making is now working the opposite way. Line 11 will be executed only if the willItBeRaining variable is false.
推薦閱讀
- Java程序設(shè)計(jì)(慕課版)
- Git Version Control Cookbook
- MySQL 8 DBA基礎(chǔ)教程
- Java游戲服務(wù)器架構(gòu)實(shí)戰(zhàn)
- Python王者歸來
- Spring Cloud、Nginx高并發(fā)核心編程
- Python金融數(shù)據(jù)分析
- Mastering Apache Spark 2.x(Second Edition)
- QGIS By Example
- SQL經(jīng)典實(shí)例(第2版)
- PHP+Ajax+jQuery網(wǎng)站開發(fā)項(xiàng)目式教程
- Developing SSRS Reports for Dynamics AX
- 時(shí)空數(shù)據(jù)建模及其應(yīng)用
- 深入實(shí)踐Kotlin元編程
- PHP 7從零基礎(chǔ)到項(xiàng)目實(shí)戰(zhàn)