1. Set up an overhead bubble panel: How To: Show Overhead Conversation Bubble Text. Add the bubble panel as an instance (child) of the actor.
2. Add additional bubble subtitle panels to your actor's GameObject -- for example, with different bubble images for different emotions.
3. Add this script to your actor:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SetBubblePanel : MonoBehaviour
{
public StandardUISubtitlePanel[] bubblePanels; //<-- SET IN INSPECTOR
void OnConversationLine(Subtitle subtitle)
{
if (subtitle == null || subtitle.speakerInfo.transform != this.transform) return;
int index = Field.LookupInt(subtitle.dialogueEntry.fields, "Bubble");
if (0 <= index && index < bubblePanels.Length)
{
DialogueManager.standardDialogueUI.ForceOverrideSubtitlePanel(bubblePanels[index]);
}
}
}
5. Add a custom Number field "Bubble" to your dialogue entries. When you want to use a different bubble, set the Bubble field to the element number in the script's Bubble Panels list.
Example scene (including script above):
DS_ChangeBubbleImageExample_2024-03-15.unitypackage