Unity3d Game Development Training

Source: Internet
Author: User

Unity3d Game Development Training

Deng Jiahai

Date: 2017-01-08

Modified: 2017-01-09 12:36:15

1 Composition of the project

Figure 1-1

As shown in 1-1, the project composition of Unity3d is divided into three main parts:

Assets: Resource unpacking, such as 3D models, 2D textures, and sounds will be somewhere in this directory

Library: Class libraries, this property contains unity3d using the Mate asset (tie assets) and logic together in the scenes reference relationship. There are also many other settings that you need for the editor preferences, platform settings, and game engines you set up.

Projectsettings: A project configuration file that undergoes a filter filter and setup when any asset asset is imported into Unity3d. Most of the time, when using 3D models and textures, they are the place to be taken before the game is ready. Unity3d will do all this automatically. Even importing a box grid from a 3D content authoring tool requires some processing before you can put it into a unity3d scene.

Temp: Temp folder, data cache, temporary files and other operating system maintenance related things are thrown into the Temp directory

2 First Unity3d item (box move up and down)

2.1 Create a new 3D project:

Figure 1-2

What's worth saying is that we have to have our own developer account, just like Apple iOS developers have to buy their own account, and the iOS online account looks like $200.

2.2 Development tools, Scenario Introduction

We choose New, create a project of our own, the project name is called Demo1, add a cube inside the hierarchy, and then add a C # script in the assets, the script is called Cubemove.

Figure 1-3

2.3 Code Development

, our first project is built, then we need to move this object, is the usual game action, then we have to write scripts to control the important part of the dry:

Set the development tool first, Edit->preferences->external Tools->vs 2013 or VS 2015

Figure 1-4

Double-click the Cubemove script to open our script code in VS 2013, and to use the script to the object, we just need to drag the script onto the cube object:

1 usingUnityengine;2 3 usingSystem.Collections;4 5 /// <summary>6 7 ///Author: Deng Jiahai8 9 ///Users: DengjiahaiTen  One ///Date Created: 2017-01-08 22:58:33 A  - ///Modify: -  the ///version: V 1.0.0.0 -  - /// </summary> -  +  Public classCubemove:monobehaviour { -  +     //Moving Speed A  at     Private floatSpeed ; -  -     //Use this for initialization -  -     /// <summary> -  in     ///start, call at the beginning -  to     /// </summary> +  -     voidStart () { the  *         //Moving Speed 1 frames $ Panax NotoginsengSpeed =1f; -  the     } +  A     the  +     //Update is called once per frame -  $     /// <summary> $  -     ///Call this method one frame at a time -  the     /// </summary> - Wuyi     voidUpdate () { the  -         //when the keyboard key is W, start moving up Wu  -         if(Input.getkey (KEYCODE.W)) About  $         { -  -Transform. Translate (vector3.up * speed *time.deltatime); -  A         } +  the         Else if(Input.getkey (KEYCODE.S))//keyboard keys are S, go down -  $         { the  theTransform. Translate (Vector3.down * speed *time.deltatime); the  the         } -  in     } the  the}

2.4 Running Results

Figure 1-5

Figure 1-5

2.5 Release The game

Create a new scene:

Figure 1-6

File->build Settings:

Figure 1-7

We can choose iOS version, Android version, PC version, and then drag the scene into the build.

Finally click Build to generate a file that can be run.

Here, the starter program is complete!

Unity3d Game Development Training

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.