![]() ![]() The curly brackets are used to put everything together within the function. We can add instructions inside the Start function by inserting them between the first bracket. The computer will always ignore any comments that are written inside scripts. Whatever is preceded by the two forward slash signs is a comment. The green text above the Start function is called a comment. The Start text in the HelloWorld script is a method. So when you are making your dinner you wouldn’t have to keep retyping each one of the instructions. This method has all the instructions for the recipe in it. So every time you wanted to make pasta you would use the method MakePasta. The make pasta recipe could be put into a Method. Lets take the pasta recipe instructions and say we wanted to use this for a dinner event and you wanted to make a dessert. In programming you are issuing statements to the computer and then the computer needs to execute, these are also executed from top to bottom. Here you have different instructions and these instructions need to be preformed in a certain order, which goes form top to bottom. For example, if you wanted to make pasta, the first step is to boil the water, then add the pasta, stir the pasta as its boiling. In a cooking recipe yo have to complete different steps. ![]() The best way to understand programming is to think of a cooking recipe. We will start by removing the Update function completely. Mac users will use a code editor called “Monodevelop.” Visual Studio is the officially recommended code editor for Windows. We will be editing this script in Visual Studio for this lesson. ![]() To open this script and edit it in the code editor you must double click on it. Once the script is named this creates a new C# script in the Scripts folder we created earlier. The standard convention for naming conventions when creating scripts is to start with a capital letter and capitalize the “W” in World. In this folder you can create a new script by right clicking>Create>C# Script in the menu that pops up. The very first thing you should do is create a new project. In this course we will use the C# programming language to add behaviors to the game objects in the project. Scripting is the same as coding or programming. In order to add behaviors to your game objects, you will need to learn scripting. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |