Show / Hide Table of Contents

Class Conversation

The base class for all conversations with an NPC. You can setup a conversation by inheriting from this class, adding the component to an NPC object, and using Speak(string) and PresentYesNoQuestion(string) in DoConversation() to talk with the player

Inheritance
object
Object
Component
Behaviour
MonoBehaviour
Conversation
Namespace: WeaverCore.Assets.Components
Assembly: WeaverCore.dll
Syntax
public abstract class Conversation : MonoBehaviour

Properties

| Edit this page View Source

DialogBoxResult

The result of the yes/no dialog box

Declaration
public Conversation.YesNoResult DialogBoxResult { get; }
Property Value
Type Description
Conversation.YesNoResult

Methods

| Edit this page View Source

DisplayTitle(string, string)

Display an WeaverBossTitle. This is mainly used to display the name of the NPC the player is talking to

Declaration
protected void DisplayTitle(string title, string minorText = "")
Parameters
Type Name Description
string title
string minorText
| Edit this page View Source

DoConversation()

Override this method to customize the conversation with a player. Use Speak(string) to speak with the player, and use PresentYesNoQuestion(string) to prevent the player with a yes/no question

Declaration
protected abstract IEnumerator DoConversation()
Returns
Type Description
IEnumerator
| Edit this page View Source

HideConversationBox()

Hides the conversation box

Declaration
public void HideConversationBox()
| Edit this page View Source

PresentYesNoQuestion(string)

Presents a yes/no question prompt to the player. The result is stored in DialogBoxResult

Declaration
protected IEnumerator PresentYesNoQuestion(string message)
Parameters
Type Name Description
string message

The message to say in the prompt

Returns
Type Description
IEnumerator
| Edit this page View Source

PresentYesNoQuestion(string, int)

Presents a yes/no question prompt to the player. The result is stored in DialogBoxResult

Declaration
protected IEnumerator PresentYesNoQuestion(string message, int geoCost)
Parameters
Type Name Description
string message

The message to speak

int geoCost

How much geo the player need to pay to select "Yes"

Returns
Type Description
IEnumerator
| Edit this page View Source

ShowConversationBox()

Shows the conversation box

Declaration
public void ShowConversationBox()
| Edit this page View Source

Speak(IEnumerable<string>)

Speaks a series of messages to the player. Each message is split into seperate pages

Declaration
protected IEnumerator Speak(IEnumerable<string> messages)
Parameters
Type Name Description
IEnumerable<string> messages

The messages to speak

Returns
Type Description
IEnumerator
| Edit this page View Source

Speak(string)

Speaks a message to the player

Declaration
protected IEnumerator Speak(string message)
Parameters
Type Name Description
string message

The message to speak

Returns
Type Description
IEnumerator
| Edit this page View Source

Speak(params string[])

Speaks a series of messages to the player. Each message is split into seperate pages

Declaration
protected IEnumerator Speak(params string[] messages)
Parameters
Type Name Description
string[] messages

The messages to speak

Returns
Type Description
IEnumerator
| Edit this page View Source

StartConversation()

Starts a conversation with the player

Declaration
public void StartConversation()
| Edit this page View Source

StartConversationRoutine(bool)

Starts a conversation with the player

Declaration
public IEnumerator StartConversationRoutine(bool makePlayerLookUp = true)
Parameters
Type Name Description
bool makePlayerLookUp

Should the player look up when starting the convo?

Returns
Type Description
IEnumerator

Extension Methods

ReflectionUtilities.ReflectCallMethod(object, string, object[], BindingFlags)
ReflectionUtilities.ReflectGetField(object, string, BindingFlags)
ReflectionUtilities.ReflectGetMethod(object, string, BindingFlags)
ReflectionUtilities.ReflectGetProperty(object, string, BindingFlags)
ReflectionUtilities.ReflectSetField(object, string, object, BindingFlags)
ReflectionUtilities.ReflectSetProperty(object, string, object, BindingFlags)
CoroutineUtilities.RunCoroutineWhile<T>(T, IEnumerator, Func<bool>)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾