Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the basis of Unity3d?

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, I will talk to you about what is the basis of Unity3d. Many people may not know much about it. In order to let you know more, Xiaobian summarized the following contents for you. I hope you can gain something according to this article.

1. The coordinate system in Unity is the left-handed coordinate system used, Y axis up, Z axis in, X axis right

2. Five panels

Hierarchy: Objects in the current scene

Project: All resources in the project

Scene: Preview view of the current scene

Inspector: Properties

Game: Game view, viewing the scene from the main camera's perspective

3. Operation of mouse

Left button: Select

Right-click: adjust perspective, coordinate system transformation

Middle key (wheel): Move canvas

4. Elements

gameObject

Component

Material

Texture

5. Script

A script is attached to a game object, and the objects of events and actions are also the game object on which the current script resides. Scripts can only be run attached to a GameObject or invoked by another script. A script can be placed on multiple GameObjects, multiple instances. Multiple instances of a script do not interfere with other scripts

6. Anti-aliasing

Main menu: Edit→Project Settings → Quality , AntiAliasing Select 4X (the larger and smoother the more resources will be consumed)

7. Use of editors

Scene: Efficient operation: holding down the right mouse button and dragging can change the direction of viewing when previewing,

Drag and hold the scroll wheel to change the viewing section laterally,

The wheel can move forward and backward

Double-click in Hierarchy to focus on elements and zoom in on areas

Click on the button, select a game object, pull the arrow in three directions, you can change the position of the element in three directions

Arrow keys can be more convenient in the XZ direction of roaming, press Shift can speed up

Inspector:

temporarily disabled game objects can be removed by hooking in front of Inspector

Temporarily want to disable the component can also be removed by removing the hook, permanently removed on the "Remove Component"

8. Commissioning

-> Runtime debug message output of the program: Debug.Log(), displayed in Console view

-> Breakpoint debugging of the project: Start MonoDevelop, main menu Tools → Options → Unity → Debugger Editor Select the program path of Unity development environment Unity.ext, then MonoDevelop opens the project (note Unity does not open this project at the same time), and then main menu Run→ Run With → Unity Debugger can start debugging.

Debug.Log() debugging is recommended

9. Model

Design models and animations in 3dmax, maya, export fbx format, some 3dmax files export fbx will have problems, such as export without mapping, no animation, etc., mainly non-standard production

Drag the generated fbx file to Assets in Unity Project, select the fbx file in Project (note: not in Hierarchy), and edit the animation in the Animations tab in Inspectpr

After the fragment is cut, the fragment must be authorized, otherwise it will prompt that there is no legacy or no animation component in the gameobject. Switch to Rig, Animation Type select legacy, Generation select "Store in Root(New)", click apply

Drag fbx into Hierarchy or Scene, and it becomes GameObject.

10. Import and export of models

After the model and animation are proposed, you can right-click on the model folder → Export Package→ Export, export to a folder, the file extension is unitypackage, later use, you can right-click → Import Package→ Custom Package to complete the package import

11. Animation playback control

if (Input.GetKey(KeyCode.LeftShift))

{

animation["Run"].speed = 1f;

animation.Play("Run");

}

The speed attribute controls the speed and direction of animation execution. Positive numbers mean forward, negative numbers mean backward. The larger the value, the faster, and the smaller the slower.

12. Script problems

-> Initialize not in constructor, but in Start() method

-> Script (instantiation) placed in the game object can modify attributes in Inspector, get/set write attributes are not recognized (do not need to write), directly public fields can be used as attributes, do not write modifiers is private

The->Time class contains an important class variable deltaTime, which represents the time since the last call to Update or FixedUpdate.

-> Click Add Component to display the directory structure. Script files are generally placed under the Scripts directory. If you want to change the directory for your own class, you need to add a feature in front of the class.

[AddComponentMenu("directory name/displayed file name")]

After reading the above, do you have any further understanding of what Unity3d is based on? If you still want to know more knowledge or related content, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report