public void UpdatePortraitImage(int deviceNum, CharacterType characterType, PortraitEmotion portraitEmotion) { Image portraitImage = PlayerDisplay(deviceNum).PortraitImage; Portrait portrait = GetPortrait(characterType); switch (portraitEmotion) { case PortraitEmotion.Neutral: portraitImage.sprite = portrait.neutral; return; case PortraitEmotion.Hit: portraitImage.sprite = portrait.hit; return; case PortraitEmotion.Joy: portraitImage.sprite = portrait.joy; return; case PortraitEmotion.Dead: portraitImage.sprite = portrait.dead; return; } Debug.LogError("Failed to find valid portrait emotion"); portraitImage.sprite = null; }
public Dialog(SpeakerInfo speaker, string text, PresentEffect effect = PresentEffect.None, PortraitEmotion emotion = PortraitEmotion.None) { Text = text; Name = speaker.Name; Portrait = speaker.Portrait; Color = speaker.Color; Alignment = speaker.Alignment; Effect = effect; Emotion = emotion; }