Hi, is it possible for example have a triangle image (instead of continue button) when there are lines available and change the triangle image to a cross image when the dialogue is going to end with the next continue button action?
Basically I have changed the continue button to an image since I don't use my mouse i trigger it with my keyboard, is there any chance to swap it for another continue button when there is going to end the dialogue?
Is it possible to detect if there is a new line and change continue button for an end button?
Re: Is it possible to detect if there is a new line and change continue button for an end button?
Hi,
Yes, you can add a small script to your continue button that checks DialogueManager.currentConversationState in OnEnable. Something like:
SetContinueButtonImage.cs
Yes, you can add a small script to your continue button that checks DialogueManager.currentConversationState in OnEnable. Something like:
SetContinueButtonImage.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class SetContinueButtonImage : MonoBehaviour
{
public Sprite continueSprite; // <-- ASSIGN THESE IN INSPECTOR.
public Sprite endSprite;
void OnEnable()
{
if (!DialogueManager.isConversationActive) return;
var isEnd = !DialogueManager.currentConversationState.hasAnyResponses;
GetComponentInChildren<Image>().sprite = isEnd ? endSprite : continueSprite;
}
}
Re: Is it possible to detect if there is a new line and change continue button for an end button?
Thanks works like a charm, great community keep the good job guys