How to reference conversations via inspector
Posted: Thu Oct 06, 2022 7:30 am
Hi everyone,
I start conversations via code through
I would like to have a field in inspector on certain GameObjects, that shows me a reference to all conversations in the conversations database. Just like in the conversations editor.
A typical use would be the scenario in which I want to define a collection of conversations that that script will start.
My current workaround is making a static class with the references
And to start the conversatios
I'd like to remove that horrific enum and use something else that avoids to me to write modify code everytime I add a new conversation or I modify the conversation title.
Thanks in advance to everyone!
I start conversations via code through
Code: Select all
StartConversation(string title)
A typical use would be the scenario in which I want to define a collection of conversations that that script will start.
My current workaround is making a static class with the references
Code: Select all
[Flags]
public enum Conversations
{
Welcome = 1 << 0,
Test1 = 1 << 1,
Test2 = 1 << 2,
//etc...
}
Code: Select all
m_rDialogueSystemController.StartConversation(nameof(DialogueSystemRefs.Conversations.Welcome));
Thanks in advance to everyone!