3using System.Runtime.CompilerServices;
4using System.Runtime.InteropServices;
20 public bool isPlaying { [MethodImpl(MethodImplOptions.InternalCall)]
get; }
31 public void Play(
string name)
41 public void CrossFade(
string name,
float duration = 1.0f)
43 INTERNAL_crossFade(name, duration);
59 public void SetLoop(
string name,
bool loop)
61 INTERNAL_setLoop(name, loop);
71 return INTERNAL_getLoop(name);
81 return INTERNAL_isPlaying(name);
95 private void CallOnEnded(
Animation sender,
string animName)
97 onEnded?.Invoke(sender, animName);
102 [MethodImpl(MethodImplOptions.InternalCall)]
103 private extern void INTERNAL_play(
string name);
105 [MethodImpl(MethodImplOptions.InternalCall)]
106 private extern void INTERNAL_crossFade(
string name,
float duration);
108 [MethodImpl(MethodImplOptions.InternalCall)]
109 private extern void INTERNAL_stop();
111 [MethodImpl(MethodImplOptions.InternalCall)]
112 private extern void INTERNAL_setLoop(
string name,
bool loop);
114 [MethodImpl(MethodImplOptions.InternalCall)]
115 private extern bool INTERNAL_getLoop(
string name);
117 [MethodImpl(MethodImplOptions.InternalCall)]
118 private extern bool INTERNAL_isPlaying(
string name);
120 [MethodImpl(MethodImplOptions.InternalCall)]
121 private extern void INTERNAL_getAnimationClipInfo(
int index, out AnimationClipInfo info);
bool IsPlaying(string name)
Returns if the animation clip is playing
delegate void AnimationEvent(Animation sender, string animName)
void SetLoop(string name, bool loop)
Set animation clip is looping by name
AnimationClipInfo GetAnimationClipInfo(int index)
Returns animation clip info by its name
void CrossFade(string name, float duration=1.0f)
Play animation clip by name with smooth transition between this and previous clips
int numAnimationClips
Get animation clips count
bool isPlaying
Returns if any of animation clips attached to this component is playing
void Play(string name)
Play animation clip by name
bool GetLoop(string name)
Get animation clip is looping by name