Summary
If the
Animancer.AnimancerState.OwnedEvents haven't been initialized yet,
this method gets them and returns true.
- Assembly
- Animancer
.dll - Namespace
- Animancer
- Containing Type
- AnimancerState
Syntax
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public AnimancerEvent.Sequence Events(Object owner)
Remarks
This method tries to ensure that the event sequence is only referenced by this state.
-
If the reference was
null , a new sequence will be created. -
If a reference was assigned to
, it will be cloned so this state owns the clone.
Animancer.AnimancerState.AssertOwnership(System.Object).
Documentation:
Animancer Events
Example:
AnimancerState state = animancerComponent.Play(animation);
state.Events(this).OnEnd ??= OnAnimationEnded;
If multiple different owners need to take turns reusing the same state,
use Animancer.AnimancerState.Events(Animancer.AnimancerEvent.Sequence@) instead.
If you need to initialize more than just the End Event,
use Animancer.AnimancerState.Events(System.Object,Animancer.AnimancerEvent.Sequence@) instead.
Attributes
| Type | Description |
|---|---|
| MethodImplAttribute |
Parameters
| Name | Type | Description |
|---|---|---|
| owner | Object |
Return Value
| Type | Description |
|---|---|
| AnimancerEvent |