Odin Inspector 系列教程 --- Disable Context Menu Attribute

Disable Context Menu Attribute:可用于任何屬性,并禁用該屬性的上下文菜單。如果您不希望屬性使用上下文菜單,請(qǐng)使用此選項(xiàng)。

using Sirenix.OdinInspector;
using UnityEngine;

public class DisableContextMenuAttributeExample : MonoBehaviour
{
    [InfoBox("禁用所有由Odin提供的右鍵上下文菜單。它不會(huì)禁用Unity的上下文菜單.", InfoMessageType.Warning)]
    [DisableContextMenu]
    public int[] NoRightClickList = new int[] { 2, 3, 5 };

    [DisableContextMenu(disableForMember: false, disableCollectionElements: true)]
    public int[] NoRightClickListOnListElements = new int[] { 7, 11 };

    [DisableContextMenu(disableForMember: true, disableCollectionElements: true)]
    public int[] DisableRightClickCompletely = new int[] { 13, 17 };


    [DisableContextMenu]
    public int NoRightClickField = 19;

    public int RightClickField = 19;
}

更多教程內(nèi)容詳見:革命性Unity 編輯器擴(kuò)展工具 --- Odin Inspector 系列教程

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容