コード例 #1
0
 public static void DoEmote(EmoteSO emoteSo, GameObject player)
 {
     foreach (var emote in Instance.emoteList.Emotes)
     {
         if (emote != emoteSo)
         {
             continue;
         }
         emote.Do(player);
     }
 }
コード例 #2
0
    /// <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();
    }
コード例 #3
0
    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);
    }
コード例 #4
0
    /// <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();
        }
    }
コード例 #5
0
 public void QueueEmote(EmoteSO emote)
 {
     emoteQueue.Enqueue(emote);
 }
コード例 #6
0
 /// <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();
 }
コード例 #7
0
 private void EmoteUpdate(EmoteSO emote)
 {
     emote.EmoteUpdate(this);
 }
コード例 #8
0
 private void EmoteStart(EmoteSO emote)
 {
     emote.EmoteStart(this);
 }