EventNamesAttribute.

EventNamesAttribute() Constructor

Summary

Creates a new Animancer.EventNamesAttribute with Animancer.EventNamesAttribute.Names from the attributed type or declaring type of the attributed member.
Assembly
Animancer.dll
Namespace
Animancer
Containing Type
EventNamesAttribute

Syntax

public EventNamesAttribute()

Remarks

Example:
[EventNames]// Use all StringReference fields in this class for any transitions in this class.
public class AttackState
{
    public static readonly StringReference HitStart = "Hit Start";
    public static readonly StringReference HitEnd = "Hit End";

    [SerializeField]
    [EventNames]// Use all StringReference fields in this class.
    private ClipTransition _Animation;

    protected virtual void Awake()
    {
        _Animation.Events.SetCallback(HitStart, OnHitStart);
        _Animation.Events.SetCallback(HitEnd, OnHitEnd);
    }

    private void OnHitStart() { }
    private void OnHitEnd() { }
}

Return Value

Type Description
void