better attributes legacy
v3.1.10
警告
包裹不棄用並替換為 - 更好的屬性

該軟件包提供以下功能:
該軟件包包含用於抽屜的基類,並具有更好的下拉。
更好的下拉包含:
提供了選擇接口實現的可能性,枚舉值,而Unity Inspector的下拉列表更好。
還支持標誌枚舉。
用法:
[ Select ] [ SerializeReference ]
private ISomeInterface someInterface ;
[ Select ] [ SerializeReference ]
private SomeAbstractClass someAbstractClass ;
[ Select ( typeof ( SomeAbstractClass ) ) ] [ SerializeReference ]
private List < SomeAbstractClass > someAbstractClasses ;
[ Select ( typeof ( ISomeInterface ) ) ] [ SerializeReference ]
private List < ISomeInterface > someInterfaces ;
[ Select ] [ SerializeField ]
private KeyCode keyCode ; 類似於選擇屬性,但允許定義自己的選擇集合。
用法:
[ Dropdown ( "Method()" ) ] [ SerializeField ]
private List < int > someInts ;
[ Dropdown ( "Method()" ) ] [ SerializeField ]
private List < int > someInts ;支持從其他類中檢索信息,以使用此selectorName使用r:
用法:
[ Dropdown ( "r:OtherClass.StaticFieldOrProperty" ) ] [ SerializeField ]
private List < int > someInts ;
[ Dropdown ( "r:OtherClass.StaticMethod()" ) ] [ SerializeField ]
private List < int > someInts ;
[ Dropdown ( "r:Singleton.Instance.Method()" ) ] [ SerializeField ]
private List < int > someInts ;
[ Dropdown ( "r:Singleton.Instance.Method()" ) ] [ SerializeField ]
private List < int > someInts ; 通過單擊Unity Inspector中的字段來查看對象預覽的可能性。
支持場景對象和預製對像以及紋理和精靈的預覽。
用法:
[ Preview ] [ SerializeField ]
private Sprite sprite ;
[ Preview ] [ SerializeField ]
private SomeMonobehaviour someMonobehaviour ; 提供了禁用Unity Inspector中字段修改但保持顯示的可能性。
用法:
[ ReadOnlyField ] [ SerializeField ]
private SomeClass someClass ;
[ ReadOnlyField ] [ SerializeField ]
private float someFloat ;
[ ReadOnlyField ] [ TextArea ( 5 , 10 ) ] [ SerializeField ]
private string someString ; 提供了在Unity Inspector中繪製有關字段的完整紋理的可能性。要獲取紋理指南打開紋理式窗口和正確的打開上下文菜單 - >轉換為iConheaderattribute。
用法:
[ IconHeader ( "TEXTURE_GUID" ) ] [ SerializeField ]
private string oldName ; 提供了從UnityEngine.Object的type sharthetex下方繪製全尺寸檢查器的可能性。
用法:
[ DrawInspector ] [ SerializeField ]
private SomeScriptable scriptable ; 提供了重命名Unity Inspector標籤的可能性。
用法:
[ RenameField ( "New Name" ) ] [ SerializeField ]
private string oldName ; 通過拖動手柄從場景視圖中設置Vector3/vector2/Quaternion/bounds的值的可能性。
[GizmoLocal]僅用於MonoBehaviour Unity Inspector。
用法:
[ Gizmo ]
[ SerializeField ] private Bounds bounds ;
[ Gizmo ]
[ SerializeField ] private Vector3 vector3 ;
[ Gizmo ]
[ SerializeField ] private Quaternion quaternion ;
[ GizmoLocal ]
[ SerializeField ] private Bounds boundsLocal ;
[ GizmoLocal ]
[ SerializeField ] private Vector3 vector3Local ;
[ GizmoLocal ]
[ SerializeField ] private Quaternion quaternionLocal ; 提供了在Unity Inspector中顯示方法顯示按鈕的可能性。
用法:
///Default usage of attribute.
[ EditorButton ]
private void SomeMethod ( )
{
//Some code.
}
///This button will call method with predefined parameters.
///When invokeParams not specified will call with null.
[ EditorButton ( invokeParams : 10f ) ]
private void SomeMethod ( float floatValue )
{
//Some code.
}
///This button will call method with predefined parameters.
///When invokeParams not specified will call with null.
[ EditorButton ( invokeParams : new object [ ] { 10f , 10 } ) ]
private void SomeMethod ( float floatValue , int intValue )
{
//Some code.
}
/// This button will be in the same row with button for SomeMethod2.
/// But will be in the second position.
/// When captureGroup not specified each button placed in separate row.
/// When priority not specified buttons in one row sorted by order in code.
[ EditorButton ( captureGroup : 1 , priority : 2 ) ]
private void SomeMethod1 ( )
{
//Some code.
}
[ EditorButton ( captureGroup : 1 , priority : 1 ) ]
private void SomeMethod2 ( )
{
//Some code.
}
/// This button will have name "Some Cool Button".
/// When displayName not specified or null/empty/whitespace button
/// will have name same as method.
[ EditorButton ( displayName : "Some Cool Button" ) ]
private void SomeMethod ( )
{
//Some code
}您可以檢查構造EditorButtonAttribute是否有更多特定的選項。
如何安裝