private void StopTalking(string characterKey) { if (MapCache.ContainsKey(characterKey)) { Animator anim = MapCache[characterKey]; if (AnimationTools.HasParameter(anim, IDLE_TRIGGER)) { anim.SetTrigger(IDLE_TRIGGER); } } }
private void OnEnable() { if (anim == null) { anim = GetComponent <Animator>(); } if (AnimationTools.HasParameter(anim, START_TIME)) { anim?.SetFloat(START_TIME, Random.Range(0f, 1f)); } }
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); } } }