字幕列表 影片播放 列印所有字幕 列印翻譯字幕 列印英文字幕 Prefabs in Unity are preconfigured game objects 預製(Prefab)在Unity裡是預先在場景內 組合好的遊戲物件並存在專案裡 that you create in the scene 他們可以被實體化(Instantiate)或拷貝(Clone) and store in the project. 意思就是在遊戲進行時 從預製產生新的實體(Instance) They can then be instantiated or cloned, 預製有許多用途 同時也是Unity開發一個重要的環節 meaning to create an instance of them 預製可以用來製作火箭 設計敵人甚至是設計關卡 during the game. 要建立一個預製 首先在場景裡建立一個遊戲物件 They have all manner of uses and are a key part 並設定好所需要的元件 of development in Unity. 然後將該物件拖曳到專案裡 就可以將它存成預製 They are used for everything from rockets 最後將場景中的遊戲物件刪除即可 to enemies, to procedural levels. 如果你想要調整預製的屬性 To make a prefab simply create your game object 你可以從專案裡選取一個預製 然後在檢視裡調整它的屬性 in it's desired configuration in your scene, 或是將它拖曳到場景上來產生一個實體 from whatever components you need, 然後再由檢視裡調整 and then drag it to the project panel 調整完成後再點選上面的Apply鈕 to save it as a prefab. 就會回存到預製 接下來你可以將預製的實體從場景上刪除 It can then be deleted from the scene. 如果你利用一個預製來產生一群實體 To edit a prefab you can either select it in the project, 然後調整了其中一個實體的屬性 and adjust properties in the inspector. 然後你希望調整也套用在其他實體上 你可以按Apply存檔 Or drag an instance of it back in to the scene, 接下來所有的實體都會同步更新 edit it in the inspector, 假如你調整了一個預製的實體 and then press the apply button at the top. 但你發現這不是你想要的調整 This saves changes back in to the prefab 這時你可以從檢視按下還原鈕(Revert) 還原到預製的設定 and you can then remove the instance from the scene yet again. Also, if you have many instances of a prefab, and you make edits to one of them, and decide you would like others to be the same you can hit apply. The other instances will inherit this update from the prefab's settings. Likewise if you make a change to one of your instances and you decide you don't like it anymore you can revert to the settings of the prefab by clicking the revert button at the top.
B2 中高級 中文 英國腔 實體 調整 物件 場景 屬性 專案 預製板 - 概念和用法 - Unity官方教程 (Prefabs - Concept and usage - Unity Official Tutorials) 126 8 朱瑛 發佈於 2021 年 01 月 14 日 更多分享 分享 收藏 回報 影片單字