public static void DoEmote(EmoteSO emoteSo, GameObject player) { foreach (var emote in Instance.emoteList.Emotes) { if (emote != emoteSo) { continue; } emote.Do(player); } }
/// <summary> /// Plays an Emote on this AnimatableController. /// </summary> /// <param name="emote">Emote</param> /// <param name="interrupt">If set to <c>true</c>, interrupt.</param> public void PlayEmote(EmoteSO emote, bool interrupt = true) { if (interrupt) { StopEmote(); ClearEmoteQueue(); ResetAnimatableFeatures(); } QueueEmote(emote); PlayNextEmote(); }
IEnumerator <float> _EmoteCR(EmoteSO emote) { float runningTime = 0f; EmoteStart(emote); while (runningTime < emote.emoteTime) { runningTime += Time.deltaTime; yield return(Timing.WaitForOneFrame); } EmoteEnd(emote); OnEmoteComplete?.Invoke(this, emote); }
/// <summary> /// Loads the animations. /// </summary> /// <param name="animations">Animations to be loaded to this feature.</param> /// <param name="emote">the EmoteSO used</param> /// <param name="startAnimating">If set to <c>true</c>, start animating feature immediately.</param> public void LoadAnimations(List <FeatureAnimationInstruction> animations, EmoteSO emote, bool startAnimating = true) { activeFeatureAnimations = animations; foreach (var inst in activeFeatureAnimations) { inst.animationLifeTime = (inst.animationLifeTime < 0) ? emote.emoteTime : Mathf.Min(inst.animationLifeTime, emote.emoteTime - inst.startOffset); } if (startAnimating) { Play(); } }
public void QueueEmote(EmoteSO emote) { emoteQueue.Enqueue(emote); }
/// <summary> /// Handles this AnimatableController's behaviour when an emote is complete. /// </summary> /// <param name="emote">Emote ScriptableObject that completed</param> private void EmoteEnd(EmoteSO emote) { emote.EmoteComplete(this); NextEmote(); }
private void EmoteUpdate(EmoteSO emote) { emote.EmoteUpdate(this); }
private void EmoteStart(EmoteSO emote) { emote.EmoteStart(this); }