Unity3D Study Notes [01]

Source: Internet
Author: User

I

Shortcut Keys for changing the scene view angle:
Shift the view by the middle mouse button;
Press the left mouse button + Alt to rotate the view;
Right-click the mouse, right-click the Alt key, or move the mouse pulley to push and pull the view;
Press the F key to quickly lock the selected target.

Unity only allows creating new projects in an empty folder.

Problem:If there are spaces in the script term, the script cannot be found in [Component]> [Scripts] in the menu.

You can only add the level to Scenes In Build to be integrated into the final compiled game.

Debug. Log ("print content ");
Debug. LogError ("the printed content is red ");

Set breakpoints:MonoDevelop-> Run-> Attach to Process-> Unity Editor
F5 crossed the current breakpoint.

[Open Editor Log] shows the resource allocation.

My development environment is Unity 4.3.4f1 + Visual Studio 2012 in Windows 7.

The [Extenrnal Tools] specified VS 2012 is invalid. Here is the solution.

In simple terms:
1. Create a. bat file under the Common7 \ IDE directory of VS 2012;
2. Write start "" % * In this. bat file *
3. Specify the. bat path in [Extenrnal Tools.


II

Planning requires calculation and evaluation of the game's values, which is the key to ensuring the game's balance.

The level editing work is mainly completed in the Unity editor.

The main job of Unity programmers is to write scripts.

In Unity, each Game Object can be called a Game Object ).

Games in Unity can have multiple components ). A component can be a script, a model, a physical collision body, a texture, a particle transmitter, or a sound player. With these components, the game body has corresponding functions. programmers can control the game body and its components by writing scripts to realize the game logic.

Unity can not only develop single-player games, but also multiplayer games. It has built-inRakNet(An online game development kit), suitable for rapid development of multiplayer games.

Unity supports almost all high-end 3D animation software (such as 3ds Max and Maya). It exports models and animations to FBX format for Unity to use.

In Unity, almost all associated operations can be performed by dragging.

? [P18]Shader settings:
[Transparent]-> [Cutout]-> [Diffuse], the material will contain Alpha information;
[Transparent]-> [Diffuse], you can obtain a translucent effect, but in some cases there may be Alpha disorder;

? [P18] [Windows]-> 【Animation]-> [Create New Clip]
Material, Main Text. offset. v

Select Main Camera and choose GameObject> Align With View. The Camera View is consistent With the current View.

Script is the core of game logic. It cannot run independently. It must be a component of a certain game body before it can run.

Only classes inherited from MonoBehaviour can be used as Unity script components.

Position of the custom script in the menu bar:
[AddComponentMenu("MyGame/Player")]

UpdateEach frame of the function is called.

InputIs a class that encapsulates input functions, including almost all keyboard, mouse, or touch operation functions.

Time. deltaTimeThe time when each frame passes.


This. transformThe Transform component of the game body is called.

Vector3The three parameters represent the moving distance in the three directions of x, y, and z.

StartThe function is automatically called once when the object is instantiated.

MonoBehaviourClass cannot be initialized using constructors.

Only PublicType attributes can be instantiated in the editor window.

DestroyThe function destroys the game body.

For games that need to be reused, we need to make them into Prefab.

The game body of Unity can only be instantiated using Instantiate and must be able to use new.

? [P29] This. transform. RotateUsed to rotate the game body. Rotate usage ??

Collision body[Box Collider] Is Trigger to Trigger it.

Rigid Body[Rigidbody] Use Gravity; Is Kinematic makes the movement of the game body not affected by physical simulation.

All players that need to participate in physical computing must have a rigid body component to work properly.

Specify TagID, [Edit]-> [Project Settings]-> [Tags]
Purpose: xx. tag. CompareTo ("xxx ").

OnTriggerEnter ()It is triggered when the collision body is in contact with each other.

VirtualVirtual method. You can override this method in a derived class.
OverrideIndicates that this is a method of rewriting.

AwakeInherited from MonoBehaviour, It will be executed once when the game body is instantiated, and prior to the Start method.

FindGameObjectWithTagObtain the game body instance.

Quaternion. LookRotationOrientation to the main character during initialization.

. UniytpackageA resource package dedicated to Unity.

Audio SourceThis component is required for all the game bodies that need voice recognition.

AudioSource. PlayOneShot (AudioClip)Play Sound.

Random. valueGenerate a random number between 0.0 and 1.0.

Can be seen in the scene, but not in the game, put inGizmosFolder.


OnGUIIs a special function used to draw the UI.

Application. QuitUsed to exit the current program.

Application. LoadLevelUsed to read the next level.

By default, there is a scene camera Audio ListenerThe volume of 3D sound depends on the distance between the sound source and the camera.

Static BatchingStatic models are integrated, but sometimes the game size increases. If you do not know the optimization principle, we recommend that you use this function with caution.

? [51] Rendering PathYou can set three rendering modes:

Deferred Lighting \ Forward Rendering \ Vertex



Document Information

  • Copyright statement: Free Reprint-non commercial-Non derivative-keep the signature | Creative Commons BY-NC-ND 3.0
  • Http://blog.csdn.net/cdztop/article/details/21840545
  • Last modification time:, January 1, March 23, 2014

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.