Exemple #1
0
 private void StopTalking(string characterKey)
 {
     if (MapCache.ContainsKey(characterKey))
     {
         Animator anim = MapCache[characterKey];
         if (AnimationTools.HasParameter(anim, IDLE_TRIGGER))
         {
             anim.SetTrigger(IDLE_TRIGGER);
         }
     }
 }
Exemple #2
0
        private void OnEnable()
        {
            if (anim == null)
            {
                anim = GetComponent <Animator>();
            }

            if (AnimationTools.HasParameter(anim, START_TIME))
            {
                anim?.SetFloat(START_TIME, Random.Range(0f, 1f));
            }
        }
Exemple #3
0
        public void StartTalking(CharacterProfile character)
        {
            string key = GetCharacterKey(character);

            if (MapCache.ContainsKey(key))
            {
                Animator anim = MapCache[key];
                if (AnimationTools.HasParameter(anim, TALKING_TRIGGER) && AnimationTools.HasParameter(anim, IDLE_TRIGGER))
                {
                    anim.ResetTrigger(IDLE_TRIGGER);
                    anim.SetTrigger(TALKING_TRIGGER);
                }
            }
        }