- Learning C# 7 By Developing Games with Unity 2017(Third Edition)
- Micael DaGra?a Greg Lukosek
- 154字
- 2021-07-02 19:59:38
What is a method?
When we write a script, we are making lines of code that the computer is going to execute, one line at a time. As we write our code, there will be things that we want our game to execute more than once. For example, we can write a piece of code that adds two numbers. Suppose our game needs to add those two numbers a hundred different times during gameplay. So you'd say, "Wow! I have to write the same code a hundred times to add two numbers together? There has to be a better way."
Let a method take away your typing pain. You just have to write the code to add two numbers once and then give this chunk of code a name, such as AddTwoNumbers(). Now, every time your game needs to add two numbers, don't write the code over and over, just call the AddTwoNumbers() method.
- ASP.NET Core:Cloud-ready,Enterprise Web Application Development
- Instant Testing with CasperJS
- Learning ArcGIS Pro 2
- Flask Web開發入門、進階與實戰
- Java程序員面試算法寶典
- MySQL數據庫管理與開發(慕課版)
- Python漫游數學王國:高等數學、線性代數、數理統計及運籌學
- Serverless架構
- Visual Basic程序設計實驗指導(第二版)
- C語言程序設計實驗指導 (第2版)
- Python Data Structures and Algorithms
- OpenGL Data Visualization Cookbook
- STM8實戰
- 程序員的成長課
- Python面試通關寶典