- 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.
推薦閱讀
- Advanced Splunk
- ASP.NET Web API:Build RESTful web applications and services on the .NET framework
- Java應用與實戰
- Arduino開發實戰指南:LabVIEW卷
- Essential Angular
- Building Cross-Platform Desktop Applications with Electron
- Linux環境編程:從應用到內核
- Internet of Things with Intel Galileo
- Instant RubyMotion App Development
- C語言程序設計同步訓練與上機指導(第三版)
- SQL Server從入門到精通(第3版)
- Android系統級深入開發
- UML2面向對象分析與設計(第2版)
- ActionScript 3.0從入門到精通(視頻實戰版)
- 網絡數據采集技術:Java網絡爬蟲實戰