Add support for images in dialogue windows (#19)

- Extend editor nodes with custom DialogueContent data type that holds either image or text
- Extend the dialogue importer to correctly process the new content into updated RuntimeDialogue content
- Update SpeechBubble to be able to display either text or image
- Add a custom property drawer for the DialogueContent to allow easy switching in graph authoring

Co-authored-by: Michal Pikulski <michal@foolhardyhorizons.com>
Reviewed-on: #19
This commit is contained in:
2025-10-08 09:34:58 +00:00
parent 7b949c5cb8
commit 3807ac652c
19 changed files with 1128 additions and 461 deletions

View File

@@ -1385,31 +1385,6 @@ Transform:
m_CorrespondingSourceObject: {fileID: 5145306031820616614, guid: fbbe1f4baf226904b96f839fe0c00181, type: 3}
m_PrefabInstance: {fileID: 94815899}
m_PrefabAsset: {fileID: 0}
--- !u!1 &103777726 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1494212192306772670, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
m_PrefabInstance: {fileID: 1743421791}
m_PrefabAsset: {fileID: 0}
--- !u!114 &103777731
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 103777726}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cb3605ae81a54d2689504e0cd456ac27, type: 3}
m_Name:
m_EditorClassIdentifier: AppleHillsScripts::Dialogue.SpeechBubble
textDisplay: {fileID: 1103549804}
displayMode: 1
typewriterSpeed: 0.05
typingSoundSource: {fileID: 0}
typingSoundFrequency: 3
useRichText: 1
dialogueDisplayTime: 3
dialoguePromptText: . . .
--- !u!1001 &104952029
PrefabInstance:
m_ObjectHideFlags: 0
@@ -446592,17 +446567,6 @@ PrefabInstance:
insertIndex: -1
addedObject: {fileID: 21238928}
m_SourcePrefab: {fileID: 100100000, guid: 4b7426bc1f8736749b68973653f4dbfb, type: 3}
--- !u!114 &1103549804 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4573570654593171780, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
m_PrefabInstance: {fileID: 1743421791}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
--- !u!1 &1106104746
GameObject:
m_ObjectHideFlags: 0
@@ -456004,11 +455968,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 3484825090253933040, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_AnchoredPosition.x
value: 2.8
value: 1.3000008
objectReference: {fileID: 0}
- target: {fileID: 3484825090253933040, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_AnchoredPosition.y
value: 5.34
value: 3.840001
objectReference: {fileID: 0}
- target: {fileID: 3484825090253933040, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@@ -457085,14 +457049,6 @@ PrefabInstance:
propertyPath: m_Camera
value:
objectReference: {fileID: 1653475492}
- target: {fileID: 4573570654593171780, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_fontSize
value: 80
objectReference: {fileID: 0}
- target: {fileID: 4573570654593171780, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_fontSizeBase
value: 80
objectReference: {fileID: 0}
- target: {fileID: 6499933157207406972, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_Name
value: DialogueCanvas
@@ -457125,13 +457081,18 @@ PrefabInstance:
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8307219291215824345, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_AnchoredPosition.x
value: -131.34683
objectReference: {fileID: 0}
- target: {fileID: 8307219291215824345, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
propertyPath: m_AnchoredPosition.y
value: -183.88577
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 1494212192306772670, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
insertIndex: -1
addedObject: {fileID: 103777731}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a8b0a1c6cf21352439dc24d3b03182db, type: 3}
--- !u!224 &1743421792 stripped
RectTransform: