Version 3.3.1.2

UniqueDrawerKey struct

Namespace: Sirenix.OdinInspector.Editor
Assembly: Sirenix.OdinInspector.Editor
public struct UniqueDrawerKey : IEquatable<UniqueDrawerKey>
Gets a unique key for any given property within a drawer.
Example
public class MyCustomTypeDrawer<T> : OdinValueDrawer<T> where T : MyCustomBaseType
{
    protected override void DrawPropertyLayout(IPropertyValueEntry<T> entry, GUIContent label)
    {
        var isToggled = entry.Context(this, "toggled", false);
        isToggled.Value = SirenixEditorGUI.Label(isToggled.Value, label);
        if (SirenixEditorGUI.BeginFadeGroup(UniqueDrawerKey.Create(entry, this), isToggled.Value))
        {
            EditorGUI.indentLevel++;
            this.CallNextDrawer(entry.Property, null);
            EditorGUI.indentLevel--;
        }
        SirenixEditorGUI.EndFadeGroup();
    }
}

Methods

Create(InspectorProperty, OdinDrawer)
Gets a unique key for any given property within a drawer.
public static UniqueDrawerKey Create(InspectorProperty property, OdinDrawer drawer)
Parameters
InspectorProperty property

The property.

OdinDrawer drawer

The drawer.

Returns
UniqueDrawerKey

Create(IPropertyValueEntry, OdinDrawer)
Gets a unique key for any given property within a drawer.
public static UniqueDrawerKey Create(IPropertyValueEntry entry, OdinDrawer drawer)
Parameters
Sirenix.OdinInspector.Editor.IPropertyValueEntry entry

The property entry.

OdinDrawer drawer

The drawer.

Returns
UniqueDrawerKey

Equals(UniqueDrawerKey)
Checks if two keys are identical.
public bool Equals(UniqueDrawerKey other)
Parameters
UniqueDrawerKey other

The other key.

Returns
System.Boolean

Equals(Object)
Checks if two keys are identical.
public override bool Equals(object obj)
Parameters
System.Object obj

Returns
System.Boolean

GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
System.Int32

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.