[HOWTO] How To: Set Continue Button Label to Continue or End
Posted: Wed Feb 16, 2022 9:34 am
To change the continue button's label to "End" for the last line in conversations and "Continue" for other lines, add a script like this to the continue button:
SetContinueButtonLabel.cs
SetContinueButtonLabel.cs
Code: Select all
using UnityEngine;
using UnityEngine.UI;
using PixelCrushers.DialogueSystem;
public class SetContinueButtonLabel : MonoBehaviour
{
void OnEnable()
{
if (!DialogueManager.isConversationActive) return;
var label = GetComponentInChildren<Text>(); // Change Text to TMPro.TextMeshProUGUI if using TextMesh Pro.
var labelValue = DialogueManager.currentConversationState.hasAnyResponses ? "Continue" : "End";
label.text = DialogueManager.GetLocalizedText(labelValue); // Localize to current language if available.
}
}