Some tricks! Unity Tips (daily use)

Source: Internet
Author: User

Sun Guangdong 2015.10.30

1, search the hierarchy hierarchy of the scene by component name, is to get the object that uses this component

2. How to find a document shortcut (that is, quickly find the document for the component)

3. How to copy and restore changes made in playback mode (only the contents of one component)
is to copy this component in the play state and then paste it in the recovery state

What if you have modified multiple components of an object? is to copy this object.

Delete the object before pasting it.

4, how to use the tone settings in play mode (is a hint bar)

The result is that in addition to the game and scene panels, they become

5. How to position the camera
Under the Gameobject menu

The difference between Move to view, Align with view, Align view to selected

        

Move to View: (ctrl+alt+f) Moves the selected gameobject to the right middle of the scene camera's field of view.
The effect of pressing the shortcut key in the Scene panel is still a bit different!

Align with View: (ctrl+shift+f) overlaps the selected gameobject with the transfrom of scene camera. If camera is selected, the camera displays the screen in the scene panel exactly. (Changes to the contents of the transform and other components of the camera)

Align View to Selected: overlaps the scene camera with the Transfrom of the selected gameobject. If camera is selected, Scene view displays the picture in this camera exactly.

6, in peacetime testing, we hope that scene's attempt to keep track of a moving object. You can do this by double-clicking the f key or Shift + F (Test: Select an object and then perform one of these two shortcut keys. Then in the position position of the Inspector panel that adjusts this object, the object is always in the center of the scene view! )

7. Operation for assigning values to array fields of the Inspector panel
1. Lock the panel where the array field is located

2. Select all objects and drag onto the array field

The result is:

8, hierarchy The extreme sort of the Brother node of the panel. (commonly used in Ugui, in fact, more often by manual drag-and-drop implementation of the idea of the tree node in the data structure of the concept of it is needless to say.) Unity provides us with a shortcut key for the first or last sibling node in a node.
Under the Gameobject menu

Self-Test

9, how to Undock the preview window (that is, select an object or resource at the bottom of the Inspector panel)

For example, select an audio resource and then right-click on the red box in the upper part of the preview window to eject, and the popup window will return to docked state!

10. Snap Tips
In order to make the vertex fit of the two models exactly and accurately, we need to use a snap tip. First, after you select the object you want to drag, press and hold the V key, and then place the mouse over the vertex that the object needs to fit, and you will notice that the moving point of the object is also moving as the mouse moves, as shown in 1-11. Then hold the vertex, and drag and drop the object to the point where the other object fits. You will find that the vertices of the two objects will be fast and accurate, as shown in 1-12. In addition, you can use the combination of the shortcut key shift+v to switch to the point selection mode if you like to keep the selection state constant and don't want to always hold the V key.

The same method fits in the vertical direction again.

We often meet in the game that the segment of the broken lattice, the distance between the broken lattice tends to present a constant value, but if we want to be in the monitoring panel in a manual input numbers will be very troublesome, so here again to use our lovely snap, but here is not set the fitting vertex, but the spacing, So it will be different. In the menu bar, find "Edit" and "snapsettings ..." to open the snap Settings "capture Settings" panel, where you will see a move x input box, a movey input box, a movez input box, A scale input box and a rotation input box, which represent the smallest unit of adsorption when you hold down the CTRL key to accurately adsorb moving, scaling, or rotating objects.

And at the bottom, there's a row of buttons that change the center axis of the object.

, where the "Snap allaxes" represents the change of all axes, x means that only the axes in the x direction are changed, y means that only the axes in the Y direction are changed, and z represents only the axes in the z direction. Below I want each 4 units in the X direction distance, add a Springboard object "Movingplatform", we can do this.

First, change the number in the Movex input box to 4, and second, select the existing "Movingplatform" object in the scene "scenes panel" or the hierarchy "hierarchy list", then find "Edit" and "Duplicate" in the menu bar Or use the shortcut key ctrl+d to copy a currently selected object "Movingplatform", and then make sure that the copied "Movingplatform" Object is selected, holding down the CTRL key and dragging in the X direction, At this point you will find that the movement of the object is always moving at a fixed value of 4 units. Using the same method, you can copy the second, third, fourth ... Broken Lattice object.

11. How to search API through the Unity Forum

A code in a post in a forum that appears underlined when the mouse is moved to unity. After clicking, you will jump!

12. Use a custom icon in the scene view for empty game objects

You can then

13. Use mathematical expressions in numeric number fields

The result of the expression after carriage return will be the final value!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. From the game development lab-Sun Guangdong

Some tricks! Unity Tips (daily use)

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.