Linking the octo localization system to the dialogue system

This commit is contained in:
2026-02-17 19:06:37 +01:00
parent 79da2e5722
commit ec89813b1b
62 changed files with 832 additions and 120 deletions
@@ -2,12 +2,17 @@ using UnityEngine;
using System.Collections.Generic;
using Unheimlich.Data.Dialogues;
using Unheimlich.Gameplay.Player;
using OctoCore.Localization;
namespace Unheimlich.Interactions.FloatingWords
{
public class ObjectDescriptionTrigger : MonoBehaviour
{
[Header("Description")]
[Tooltip("Localized description text (recommended)")]
[SerializeField] private OctoLocalizedTextData _descriptionTextLocalized;
[Tooltip("Fallback description text if localized version is not set")]
[SerializeField] private string _descriptionText = "Mysterious Object";
[Header("Settings")]
@@ -99,12 +104,16 @@ namespace Unheimlich.Interactions.FloatingWords
ObjectDescriptionTriggerReference triggerRef = _wordsRotator.AddComponent<ObjectDescriptionTriggerReference>();
triggerRef.Trigger = this;
string descText = _descriptionTextLocalized != null
? OctoLocalization.GetLocalizedText(_descriptionTextLocalized)
: _descriptionText;
List<DialogueChoiceData> dummyChoices = new List<DialogueChoiceData>();
for (int i = 0; i < _settings.WordCount; i++)
{
dummyChoices.Add(new DialogueChoiceData
{
ChoiceText = _descriptionText,
ChoiceText = _descriptionTextLocalized,
NextNode = null
});
}