Unity – Inspector 的陣列操作

這真的是鮮少人知的功能哪~

想要用的時候又忘記怎用,還是先筆記一下!這是來自同事分享的一篇文章『Unity Editor Lesser Known Features

4) Inserting and Deleting Items From Arrays In Inspector – Populating arrays using the Unity editor is very handy, that is until you realize that you need to remove or add an item in the middle of the array. It might appear that there is no way to do this, but there is. To duplicate an item, select it and hit Ctrl-D (Windows), Command-D (Mac). To delete an item, hit Shift-Delete twice (once to clear, second time to remove it)

選取陣列中的某個項目後…

Ctrl-D : 在該物件下面"插入"一個複製的項目

Shift-Delete : 如果該物件不為 null 則清除(等同一般 delete);若該物件為 null,則"刪除"該物件。

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s