Use conditions through C#

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
forrestuv
Posts: 64
Joined: Tue Nov 06, 2018 11:28 am

Use conditions through C#

Post by forrestuv »

Hi,
I prefer to drive conversations using StandardDialogueUI inherited class, since I don't wanna use LUA variables and conditions.
I would just need to disable a branch/link upon an internal condition before stepping to next node
What's the best way to do this in C#?
(I've already managed to override ShowSubtitle(), ShowResponses() being able to disable certain responses)

thx
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Use conditions through C#

Post by Tony Li »

Hi,

Assign a delegate to DialogueManager.isDialogueEntryValid. Example:

Code: Select all

DialogueManager.isDialogueEntryValid = CheckMyCSharpConditions;
...
bool CheckMyCSharpConditions(DialogueEntry entry)
{
    // If  entry's C# conditions are valid right now, return true. Otherwise return false.
}
Post Reply