乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      Transforms 變換

       有趣的永 2015-12-24

      Transforms are a key Component in every GameObject. They dictate where the GameObject is positioned, how it is rotated, and its scale. It is impossible to have a GameObject without a Transform. You can adjust the Transform of any GameObject from the Scene View, the Inspector, or through Scripting.

      變換是每個游戲物體(GameObject)的關(guān)鍵組件。它們決定GameObject的位置,旋轉(zhuǎn)和縮放。有不帶變換組件的游戲物體是不可能的。可以從場景視圖、檢視面板、或通過腳本調(diào)整任意GameObject的變換。

      The remainder of this page's text is from the Transform Component Reference page.

      Transform Component Reference頁面查看更多描述。

      Transform 變換

      The Transform Component determines the actual Position, Rotation, and Scale of all objects in the scene. Every object has a Transform.

      變換組件決定場景中所有物體的實際位置、旋轉(zhuǎn)和縮放。每個物體都具有變換組件。


      The Transform Component is viewable and editable in the Inspector
      變換組件在檢視面板是可見可編輯的。

      Properties 屬性

      • Position 位置
        Position of the Transform in X, Y, and Z coordinates.
        變換在x,y,z坐標(biāo)的位置
      • Rotation 旋轉(zhuǎn)
        Rotation of the Transform around the X, Y, and Z axes, measured in degrees.
        變換圍繞x,y,z軸旋轉(zhuǎn),以度為單位測量。
      • Scale 縮放
        Scale of the Transform along X, Y, and Z axes. Value "1" is the original size (size at which the object was imported).
        變換沿x,y,z軸縮放,值為1表示原始大小

      All properties of a Transform are measured relative to the Transform's parent. If the Transform has no parent, the properties are measured relative to World Space.

      變換的所有屬性相對于變換的父級測量。如果變換沒有父級,該屬性將相對于世界空間測量。

      Using Transforms 使用變換

      Transforms are always manipulated in 3D space using X, Y, and Z axes. In Unity, these axes are represented by the colors red, green, and blue respectively. Remember: XYZ = RGB.

      變換總是在3D空間使用x,y,z軸操控。在Unity,這些軸的顏色用紅色,綠色,和藍(lán)色分別代表。這樣記憶:XYZ = RGB 。


      Color-coded relationship between 3 axes and Transform properties 變換屬性的三軸顏色的關(guān)系

      Transform Components can be directly manipulated using the Scene View or the Inspector. The Inspector will list the properties stated above for easy editing. You can also modify Transforms in your Scene by interacting with them, using the Move, Rotate, and Scale tools. These tools are located in the upper left-hand corner of the Unity Editor.

      變換組件可以使用場景視圖工具或檢視面板直接操作。在檢視面板將列出屬性,輕松的編輯。也可以在場景直接交互修改變換,使用移動、旋轉(zhuǎn)和縮放工具。這些工具在Unity編輯器的左上角。


      The View, Translate, Rotate, and Scale tools 視圖、移動、旋轉(zhuǎn)和縮放工具

      The tools will be usable on any object in your scene. Click on the object, and you will see the tool gizmo appear around it. Depending on the current tool, the gizmo will look slightly different. Clicking the object will also cause the Transform component to become visible in the Inspector. If the Inspector does not display the Transform component or its properties, then you do not have an object highlighted in the Scene View.

      這些工具可以用于場景中任何物體。在物體上點擊,可以看到工具的gizmo顯示。根據(jù)當(dāng)前選擇的工具gizmo的樣式將會不同。點擊物體也會使變換組件在檢視面板變?yōu)榭梢姟H绻跈z視面板不顯示變換組件或它的屬性,那么是你在場景中沒有選擇物體。



      All three Gizmos can be directly edited in Scene View.

      在場景視圖中可以直接編輯的三種Gizmo。

      To manipulate the Transform, click and drag on one of the 3 gizmo axes, you'll notice its color changes. As you drag the mouse, you will see the object translate, rotate, or scale along the axis. When you release the mouse button, you'll notice that the axis remains selected. You can click the middle mouse button and drag the mouse to manipulate the Transform along the selected axis. To access all 3 axes at once click and drag the center point of all 3 gizmos.

      若要操縱變換,點擊并拖拽其中一個gizmo軸,你會發(fā)現(xiàn)軸的顏色會改變。拖動鼠標(biāo)看物體沿軸的移動、旋轉(zhuǎn)和縮放。當(dāng)釋放鼠標(biāo)時,你會發(fā)現(xiàn),軸仍在保持選中狀態(tài),點鼠標(biāo)中鍵拖拽鼠標(biāo)來操作沿著選擇的軸操作變換。要訪問全部3個軸點擊3個軸中間的方塊拖動鼠標(biāo)。


      Any individual axis will become selected when you click on it 任意軸當(dāng)你點擊它是被選擇

      Parenting 父子級

      Parenting is one of the most important concepts to understand when using Unity. When a GameObject is a Parent of another GameObject, the Child GameObject will move, rotate, and scale exactly as its Parent does. Just like your arms are attached to your body, when you turn your body, your arms move because they're attached. Any object can have multiple children, but only one parent.

      在使用Unity時,父子級是一個需要理解的很重要的概念。當(dāng)你游戲物體是另一個游戲物體的父級時,子游戲物體將準(zhǔn)確的按照父物體那樣移動、旋轉(zhuǎn)和縮放,就如同胳膊附著在身體上一樣,當(dāng)你活動身體,胳膊也會移動,因為它是附著在身體上的。任何物體可以有多個子物體,但只會有一個父物體。

      You can create a Parent by dragging any GameObject in the Hierarchy View onto another. This will create a Parent-Child relationship between the two GameObjects.

      同在層級視圖拖拽任意游戲物體到另一個上面就可以創(chuàng)建父物體,這會在兩個游戲物體直接創(chuàng)建父子關(guān)系。


      A real-world example of a Parent-Child hierarchy. All the GameObjects with arrows to the left are Parents.

      父子級的例子,所有帶有向左箭頭的都是父物體

      In the above example, we say that the arms are parented to the body, and the hands are parented to the arms. The scenes you make in Unity will contain collections of these Transform hierarchies. The topmost parent object is called the Root object. When you move, scale, or rotate a parent, all the changes in its Transform are applied to its children as well.

      在上面的例子中我們說身體是胳膊的父物體,而胳膊又是手的父物體。在Unity中制作場景包含這些變換層級,最頂級父物體被稱為Root object(根物體)。當(dāng)移動、縮放或旋轉(zhuǎn)父級,所有變換的改變將應(yīng)用到它的子物體。

      It is worth pointing out that the Transform values in the Inspector of any Child GameObject are displayed relative to the Parent's Transform values. These are also called the Local Coordinates. Through scripting, you can access the Global Coordinates as well as the Local Coordinates.

      需要特別指出的是,在檢視面板任何子游戲物體顯示的變換的值相對于父變換的值。這也稱為局部坐標(biāo),通過腳本,也可以訪問全局坐標(biāo),像訪問局部坐標(biāo)一樣。

      You can build compound objects by parenting multiple separate objects together, like the skeletal structure of a human ragdoll. You can also create small yet effective objects with single parents. For example, if you have a horror game that takes place at night, you can create an effective atmosphere with a flashlight. To create this object, you would parent a spotlight Transform to the flashlight Transform. Then, any alteration of the flashlight Transform will affect the spotlight, creating a convincing flashlight effect.

      可以通過父子級多個單獨的物體到一起,來構(gòu)建復(fù)合物體,像人偶的骨骼結(jié)構(gòu)。還可以創(chuàng)建只帶一個父物體小而有效的物體。例如,你有一個恐怖游戲,發(fā)生在夜間,可以創(chuàng)建帶有手電筒的實際氛圍。要創(chuàng)建這個物體,需要父子化聚光燈變換到手電筒變換,然后,手電筒變換的任何改變將影響聚光燈,創(chuàng)建一個具有說服力的手電筒效果。

      Importance of Scale 縮放的重要性

      The scale of the Transform determines the difference between the size of your mesh in your modeling application, and the size of your mesh in Unity. The mesh's size in Unity (and therefore the Transform's scale) is very important, especially during physics simulation. There are 3 factors that can determine the Scale of your object:

      變換的縮放決定網(wǎng)格物體在建模程序和Unity中的大小。在Unity網(wǎng)格物體的大小是非常重要的,尤其是在物理模擬時。有三個因素決定物體的縮放:

      • The size of your mesh in your 3D modeling application.
        在3D建模程序中網(wǎng)格物體的大小
      • The Mesh Scale Factor setting in the object's Import Settings.
        在物體的導(dǎo)入設(shè)置中設(shè)置的網(wǎng)格物體縮放系數(shù)
      • The Scale values of your Transform Component.
        變換組件的縮放值

      Ideally, you should not adjust the Scale of your object in the Transform Component. The best option is to create your models at real-life scale, so you won't have to change your Transform's scale. The second-best option is to adjust the scale at which your mesh is imported in the Import Settings for your individual mesh. Certain optimizations occur based on the import size, and instantiating an object that has an adjusted scale value can decrease performance. For more information, read through the Rigidbody component's section on optimizing scale.

      理想的情況是不在物體的變換組件中調(diào)整縮放。最佳選項是建模時按照實際大小,這樣就不用修改變換的縮放。第二較好的選項是,針對個別網(wǎng)格導(dǎo)入時,在導(dǎo)入設(shè)置中來調(diào)節(jié)縮放。某些優(yōu)化是基于導(dǎo)入時的大小,實例化一個物體要調(diào)整縮放值,可能會影響性能。更多信息參考剛體組件章節(jié)中的優(yōu)化縮放。

      Hints 提示

      • When parenting Transforms, put the parent's location at 0,0,0 before applying the child. This will save you many headaches later.
        當(dāng)父子級變換時,應(yīng)用到子物體之前,把父物體放置到坐標(biāo)0,0,0,這將在后期節(jié)省你很多頭疼問題。
      • Particle Systems are not affected by the Transforms Scale. In order to scale a Particle System, you need to modify the properties in the System's Particle Emitter, Animator and Renderer.
        粒子系統(tǒng)不受變換縮放的影響。為了縮放粒子系統(tǒng),需要修改系統(tǒng)的粒子發(fā)射器,動畫和渲染的屬性。
      • If you are using Rigidbodies for physics simulation, there is some important information about the Scale property to be read on the Rigidbody page.
        如果為物理模擬使用剛體,有一些重要的信息,在剛體頁面閱讀縮放屬性。
      • You can change the colors of the Transform axes (and other UI elements) from the Unity Menu->Preferences->Colors & keys.
        可以從菜單修改變換軸的顏色,Edit->Preferences->Colors & keys
      • If you can avoid scaling, do so. Try to have the scales of your object finalized in your 3D modeling application, or in the Import Settings of your mesh.
        如果能夠避免縮放,盡量避免。盡量在3D建模軟件中按實際物體大小,或者在網(wǎng)格物體導(dǎo)入設(shè)置中設(shè)置好。

      頁面最后更新:2007-11-16

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多