TypeSelectionButton Struct

Summary

[Editor-Only] A button that allows the user to select an object type for a [UnityEngine.SerializeReference] field.
Assembly
Animancer.dll
Namespace
Animancer.Editor
Interfaces
  • IDisposable
Base Types
  • ValueType
graph BT Type-->Base0["ValueType"] Type-.->Interface0["IDisposable"] Type["TypeSelectionButton"] class Type type-node

Syntax

public readonly struct TypeSelectionButton : ValueType, IDisposable

Examples

public override void OnGUI(Rect area, SerializedProperty property, GUIContent label)
{
    using (new TypeSelectionButton(area, property, label, true))
    {
        EditorGUI.PropertyField(area, property, label, true);
    }
}

Constructors

Name Summary
TypeSelectionButton(Rect, SerializedProperty, bool) Creates a new Animancer.Editor.TypeSelectionButton.

Fields

Name Constant Value Summary
Area
The pixel area occupied by the button.
EventType
The original UnityEngine.Event.type from when this button was initialized.
Property
The UnityEditor.SerializedProperty representing the attributed field.

Methods

Name Value Summary
CopyCommonFields(Object, Object) void
Copies the values of all fields in `from` into corresponding fields in `to` as long as they have the same name and compatible types.
static
CreateDefaultInstance(Type) Object
Creates a new instance of the `type` using its parameterless constructor if it has one or a fully uninitialized object if it doesn't. Or returns null if the System.Type.IsAbstract.
static
CreateDefaultInstance<T>() T
Creates a T using its parameterless constructor if it has one or a fully uninitialized object if it doesn't. Or returns null if the System.Type.IsAbstract.
static
DoGUI() void
Draws this button's GUI.
GetDerivedTypes(Type) List<Type>
Returns a list of all types that inherit from the `baseType`.
static
IsViableType(Type) bool
Is the `type` supported by UnityEngine.SerializeReference fields?
static