Unity- problems encountered by small summary

1. event trigger back method can not display a corresponding


The reason: I was directly dragged into the script, which is not instantiated, should be dragged into this mount GameObject script on it

2. Make prefeb

The single game object in the scene and drag with the mouse in the Project panel Assets directory, you can create the game object of prefab
attention must be dragging a "single" game objects to create a directory under Assets prefab, if you need more Create game objects together into a Prefab, will need to select or generate a "root" (we usually use Create> Create empty to create an empty node do "root"), rename the transform property of the root node is reset ( Reset), then all game objects onto the object becomes its sub-root node, and then finally onto the root directory is created under Assets prefab.

3. Default ugui displayed in text blurred

The scale resolve to write little point and font size, and then more and more wide high magnification, it is the perfect solution, instantly improve clarity, thief 6

4. The display control hierarchy ui toolbar.transform.SetSiblingIndex (100); // higher the number in the upper layer

5. monitor toggle group in hopes accepted method to write the script for this event with a bool argument, then you can find the code: there will be two identical remember, select the one above

6. The child object traversing of the object

GetComponentsInChildren () Gets an object and sub-object as well as the Sun itself
foreach (Transform child in the parent object .transform) only to walk the child object, and the object itself, not the Sun

7.scrollview use of

1. Display area how to control?

Scroll View node in the assembly Rect Transform Width and Height controls the entire region size, scroll bars Scroll Rect assembly is provided also affects the position of the boundary of the display area is complete;
attribute affects the Type node Viewport Image display Image components of region;
node Content Rect Transform component layout and the width and height of the affected area of the display.

2. How to remove the scroll bar?

Scroll View node in the assembly Scroll Rect attributes and Vertical Scrollbar Horizontal Scrollbar set to None, and its child nodes Scrollbar Horizontal Scrollbar Vertical and delete.

3. Cause can not slip or automatically spring back to the original place of appearance?

If the width or height is less than the node Content width or height of the actual content, such a situation occurs. This may require adjustment of the width and height Content, Content Size Fitter component added or the corresponding direction is set to adapt to the width and height from the Preferred Size.

8. Add the button to the spirit state were set up across the state and click state, after clicking the button stay in that spirit across the state


The default is Automatic Navigation, and later changed to none Click to normal
9. level, if you have multiple cameras and a range of intake, in order to not disturb each individual camera shining into their own content, you can use the Layer

to object designation new Layer, and then specify which camera to display intake

10.unity force a refresh

Achieve bubble box, the length of the highly adaptive, found in the adaptive process did not change automatically, to recalculate the layout LayoutRebuilder.ForceRebuildLayoutImmediate (RectTransform) the need should be refreshed;

In the public may belong to no number [Mr.] (ID: fansGoogle) feedback information, get all the attention to the public free number resources (tutorials, operations, software, money, etc.).

Guess you like

Origin www.cnblogs.com/zhimalier/p/11596869.html