Android Development Unity3d Base Android development

Source: Internet
Author: User

Development environment

Window 7

Unity3d 3.3.0

MB525 Defy Android 2.1-update1

This study:

1. Understanding Unity

2.unity3d Environment Building and Android software generation

3.unity3d Basic Use Method

1. Understanding Unity3d

Unity3d is a game development tool that enables developers to create the same game on multiple platforms, with professional image processing and game engines to make a variety of games.

Feather used to think that Android game development can only in eclipse inside the code, perhaps it is not enough experience, do not know the game engine can bring such a great convenience to game development, whether it is 3D games or 2D games can be developed with Unity3d and turn into the iphone game is also very simple, Because Unity3d many mobile development features the iphone is shared with Android, and the main controller is the same, so we basically say goodbye to eclipse ...

Because the script inside the Unity3d is written in C # or Java script, learn the two languages the best, will not matter, but also can learn (and feather the same), in fact, C # and JS and Java similar, it does not look so strange, to note that no matter what the variable statement js is " Var "indicates that this is good for a feather that declares a frequent error-0-

2. Unity3d Environment Building and Android software generation method

Here we introduce two websites, which can be downloaded to the latest UnitySetup-3.3.0 including hack patch U3v3.3.0f4_win and Script Editor UnityScriptEditor2.55, there are a lot of learning materials, including feathering is learning the Unity Video tutorial (all english ah =. =), there are all Chinese help documents, although the information is very few now, but can see unity3d more and more ...

Http://3d.ceeger.com/Unity3D Chinese Help document

The installation process is not written in detail, very simple. Note here that the installation of the system user name is not Chinese, or open unity3d after the scene inside see things, this is the feather of the cutting raw experience-.

1) When you open Unity3d for the first time, the interface for creating project will appear, which is the same as Eclipse's creation, when you can add some plug-in packages, which are left behind when the software is opened.

2) After the new development of the interface has appeared, here is a brief introduction:

Scene Development View: The inside can drag the object position, change the size, rotation angle, etc., is the most common place in the development.

Game Game view: After the run of the point above, the Games will run in the play view and you will see the current image of the camera without any point.

Hierarchy layer tries to: Place the game object, can observe the game object change when the game is running

Project Project view: Inside you can create new folder management scripts, renderings, pictures, and more.

Inspector Check View: Show object Properties, etc.

At the bottom of the article, the general situation will not show things, if the error or print statements are displayed below

[Localimg=800,486]1[/localimg]

No matter how much it is, build an Android software again.

3) in project, right-click--〉import package--〉standard Assets (MOBILE) This is the package of the development of the move, all import imports it. In project, select the imported standard Assets (Mobile) ——— 〉control setups--〉camerarelativesetup, which prompts you to save the scene, we save one, You can see that there is a scene in project that we saved, and the game is running from scene, and you should see the package display. At a glance this is a demo controller package, this time we do not care how this works, first put on the Android phone to see the effect.

4) Click on the File menu in the upper left corner--〉build settings--〉 Check android--〉 right development Build tick on--〉 click on player Settings below, At this time in the Insperctor view can see some basic settings, the first resolution and presentation is the game view settings, horizontal screen or vertical screen with you can default it, click on other Settings, Here the main setting identification this property, the first is equivalent to the project package, this must not be the default, you can write a name like feather is com. Lb.first Other settings you can do your own research, for the generation of this software, this step must be changed.

5) then go back to the window click Build, where the first point will jump out of a selected Android SDK path, we all know, where you choose, OK, enter an apk name, called as lb, if anything wrong, you can look at the following tips.

6) The software has been generated after the installation can be thrown into the phone to try, you can directly drop in the SD card installed, here feather to introduce a simple method, for the simulator or the real machine are applicable, first set the environment variables, in the path to add such as feather their own directory d:\ Android-sdk-windows\platform-tools, so you can command in the command console, such as the feather installation of the command is CD C:\Users\LiBei\Documents\LB first to the APK directory, and then enter the ADB Install lb.apk here to note if you originally installed the same name software, first uninstalled the reload.

7) Actual operation effect left rocker is control displacement, right joystick is control direction

[Localimg=340,600]2[/localimg]

Steps look a lot, in fact very simple.

3.unity3d Basic Use Method

Here feather recommend you look at the video, see the video learned quickly, feather on the video to tell the example, after decompression can be opened by the Open Project option This example, select scene inside the Scene1 open, run is on the computer.

1) Scene creation

It's all cube-built, and you'll know at a glance that cube can be created in the top gameobject--〉create other and click Create under Hierarchy Layer view, Position adjustment can be adjusted in scene through the upper left corner of the object options, the first is to observe, the second is to adjust the position, the third is to adjust the angle, the fourth size adjustment.

2) Main View

The main point of view here is to use standard Assets (which you import yourself)--〉character Controllers--〉first person Controller can see that the objects can be directly used here are prefab presets. Here can look at the sky, in fact, the use of Skybox components, select the main camera can be component--〉rendering--〉skybox in the menu.

3) Light

If there is no light running in the dark piece, here put a point lights light, the value can be adjusted to add the same as cube.

4) script

Script placed in the Scripts folder, the inside door is the control door switch, shoot is a mouse click event, respawn is falling back to the place. Note that the script is written so that it can be dragged onto the object to be run.

5) Animation

The open door is actually an animation, created in Component--〉miscellaneous--〉animation

6) Flame

The flame is generated by the particles, and the particle creation is similar to the cube, and the values in the particle system will have a flame effect if they are adjusted accordingly.

[Localimg=723,600]3[/localimg]

Introduce some important components in component

1) rigidbody Rigid body

A rigid body, as its name implies, has a weight and a collision is a property of a rigid body, and if you add this component to an object, it proves that you need the preceding properties.

2) Character characters

In fact, the inside of the control point of view or the protagonist operation of the script.

3) Trail Renderer Path renderer

Useful components, you can see the path you have walked, the forum has a cut fruit knife light example is used it.

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.