12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- using System;
- using UnityEngine;
- using Object = UnityEngine.Object;
- namespace Animancer.Examples.Events
- {
-
-
-
-
- [HelpURL(Strings.DocsURLs.ExampleAPIDocumentation + nameof(Events) + "/" + nameof(EventUtilities))]
- public static class EventUtilities
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public static readonly Action LogCurrentEvent = () =>
- {
- Debug.Log(
- $"An {nameof(AnimancerEvent)} was triggered:" +
- $"\n- Event: {AnimancerEvent.CurrentEvent}" +
- $"\n- State: {AnimancerEvent.CurrentState.GetDescription()}",
- AnimancerEvent.CurrentState.Root?.Component as Object);
- };
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public static readonly Action RestartCurrentState = () =>
- {
- AnimancerEvent.CurrentState.Time = 0;
- };
-
-
-
-
-
-
-
-
-
- public static readonly Action PauseAtCurrentEvent = () =>
- {
- AnimancerEvent.CurrentState.IsPlaying = false;
- AnimancerEvent.CurrentState.NormalizedTime = AnimancerEvent.CurrentEvent.normalizedTime;
- };
-
- }
- }
|