Linking the octo localization system to the dialogue system
This commit is contained in:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user