public void TriggerDialog(DogEmotion em) { var data = GetEmotion(em); dialogText.text = data.text; dialogPanel.color = data.color; dialogPanel.gameObject.SetActive(true); decayTimer = DialogDecayTime; }
EmotionData GetEmotion(DogEmotion em) { string val = System.Enum.GetName(typeof(DogEmotion), em); return(Emotions.Single(e => e.name == val)); }