Linking the octo localization system to the dialogue system
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using OctoCore.Localization;
|
||||
|
||||
namespace Unheimlich.Data.Dialogues
|
||||
{
|
||||
@@ -7,13 +8,8 @@ namespace Unheimlich.Data.Dialogues
|
||||
public class DialogueNode : ScriptableObject
|
||||
{
|
||||
[Header("Content")]
|
||||
[TextArea(3, 10)]
|
||||
[Tooltip("Text displayed for this dialogue node")]
|
||||
public string DialogueText;
|
||||
|
||||
[Header("Localization")]
|
||||
[Tooltip("Localization key for the dialogue text")]
|
||||
public string DialogueTextLocalizationKey;
|
||||
[Tooltip("Localized text displayed for this dialogue node")]
|
||||
public OctoLocalizedTextData DialogueText;
|
||||
|
||||
[Header("Choices")]
|
||||
[Tooltip("List of available choices for this dialogue. If empty, this is an end node")]
|
||||
@@ -22,6 +18,14 @@ namespace Unheimlich.Data.Dialogues
|
||||
[Header("End Node Settings")]
|
||||
[Tooltip("For end nodes (no choices), delay in seconds before automatic close. 0 = requires player interaction to close")]
|
||||
public float AutoCloseDelay = 3f;
|
||||
|
||||
public string GetLocalizedDialogueText()
|
||||
{
|
||||
if (DialogueText != null)
|
||||
return OctoLocalization.GetLocalizedText(DialogueText);
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public bool IsEndNode()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user