[Unity] Chapter 1 Unity Script Development basics, Chapter 2 unity Script Development
Classification: Unity, C #, VS2015
Date created: 1. Introduction
The attraction of a game lies in its interactivity. If the game has no interaction, the scenario will be more beautiful and exquisite, and it is difficult to call it a game.
In Unity, game interaction is implemented through Script Programming. The script can be understood as the instruction code attached to the game object to define the behavior of the game object. Through scripts, developers can control the creation and destruction of each game object and the behavior of the object under various circumstances to achieve the expected interaction effect.
Script Development in Unity is very simple and efficient, because the Unity editor integrates many script editing functions, for example, the connection between scripts and Game objects, the modification of variable values, and the real-time preview of the game effect after the script is modified save a lot of time for adjustment and debugging during Script Development, this improves the efficiency of game development.
In addition, Unity has a built-in script resource package that provides a wide range of common scripts for game development to help developers quickly implement basic game functions. Ii. script languages supported by Unity
The Unity script language runs on Mono-based. NET platform. Therefore, various. NET libraries can be used, which provides a good solution for XML, database, and regular expressions. In addition, unlike traditional interpreted scripting languages, scripts in Unity are compiled, so they run quickly.
However, VS2015's editor and debugger are much better than MonoDevelop (for example, setting breakpoints), and you do not have to switch back and forth between VS2015 and Unity when creating or modifying multiple scripts, you can directly create and edit multiple script files in VS2015. After all the modifications to the script are completed and saved (Note: You must save them), and then switch to Unity to directly use these scripts. In addition, the synchronization between Unity and VS2015 is completed automatically, and you do not need to exercise this mind. You only need to edit and save it in VS2015.
Therefore, when developing games with Unity, the preferred scripting language is C #, and the preferred Script Editor is VS2015.
All examples in this chapter are in the ch06Demos project.