I have a method that runs a dialog when a button is pressed and I need that button to stop activating after certain turns. So I made this method:
public void StopAction() {
if (actionTaken < 3)
{
actionTaken++;
}
else
{
return;
}
But if I added it here it doesn’t work, the dialogue still start:
public void DialogueStart() {
//adds the dialogue lines
DialogueFile();
//opens the dialogue box and starts speech
thisBox.SetActive(true);
StartSpeech(TextBoxManager.instance.talk);
}
But the thing is if I hard coded the contents of the StopAction method into the DialogueStart method it works. Is there a way to make it work or do I really have no choice but put the contents of StopAction()
into DialogueStart()
?