- Learning C# by Developing Games with Unity 3D Beginner's Guide
- Terry Norton
- 144字
- 2021-08-04 10:04:04
Chapter 5. Making Decisions in Code
One of the primary duties of a computer is controlling what happens next when certain conditions are met. That's what computers do whether the code is controlling an application or a game. We write scripts to make GameObjects behave a certain way one moment, then the behavior should change when the conditions change. A script has to detect when the conditions change, then make the appropriate code execute based on the new conditions. This chapter looks at some examples of the ways that conditions can change, and the code to detect these changes. This in turn determines which code in the script is executed next.
In this chapter we will discuss:
- If statement decisions
- Checking for many conditions
- If-else statement decisions
- User's input condition changes
- Looping though data in an Array, List, or Dictionary
Let's begin...
推薦閱讀
- Learn TypeScript 3 by Building Web Applications
- R語言經典實例(原書第2版)
- 深入淺出WPF
- PHP+MySQL網站開發項目式教程
- Oracle JDeveloper 11gR2 Cookbook
- Web Development with MongoDB and Node(Third Edition)
- Mastering Android Game Development
- 新一代SDN:VMware NSX 網絡原理與實踐
- C++20高級編程
- 區塊鏈技術進階與實戰(第2版)
- 編程可以很簡單
- Building Serverless Web Applications
- Julia數據科學應用
- Learning Python Data Visualization
- Learning Concurrency in Python