Table of Contents

Class Conversation

Represents a conversation containing a sequence of dialogs. Create via Assets > Create > WitShells > Dialogs Manager > Conversation.

public class Conversation : ScriptableObject
Inheritance
Conversation
Extension Methods

Properties

ConversationName

The name of this conversation.

public string ConversationName { get; set; }

Property Value

string

CurrentDialog

Gets the current dialog without advancing.

public DialogObject CurrentDialog { get; }

Property Value

DialogObject

CurrentDialogIndex

The current dialog index (0-based). Returns -1 if not started.

public int CurrentDialogIndex { get; }

Property Value

int

Description

Optional description for this conversation.

public string Description { get; set; }

Property Value

string

Dialogs

The array of dialogs in this conversation.

public DialogObject[] Dialogs { get; }

Property Value

DialogObject[]

HasStarted

Whether the conversation has been started.

public bool HasStarted { get; }

Property Value

bool

IsAtLastDialog

Whether the conversation is at the last dialog.

public bool IsAtLastDialog { get; }

Property Value

bool

Loop

Whether the conversation will loop.

public bool Loop { get; set; }

Property Value

bool

TotalDialogs

The total number of dialogs in this conversation.

public int TotalDialogs { get; }

Property Value

int

Methods

GetDialogAt(int)

Gets a dialog at a specific index without changing the current index.

public DialogObject GetDialogAt(int index)

Parameters

index int

The index of the dialog to get.

Returns

DialogObject

The dialog at the specified index, or null if out of range.

GetNextDialog()

Gets the next dialog and advances the index.

public DialogObject GetNextDialog()

Returns

DialogObject

The next dialog, or null if no more dialogs.

GetPreviousDialog()

Gets the previous dialog and moves the index back.

public DialogObject GetPreviousDialog()

Returns

DialogObject

The previous dialog, or null if at the beginning.

GetProgress()

Gets the progress of the conversation (0-1).

public float GetProgress()

Returns

float

GetTotalAudioDuration()

Gets the total duration of all audio clips in the conversation.

public float GetTotalAudioDuration()

Returns

float

HasMoreDialogs()

Whether there are more dialogs to play.

public bool HasMoreDialogs()

Returns

bool

ResetConversation()

Resets the conversation to the beginning.

public void ResetConversation()

SetDialogIndex(int)

Sets the current dialog index.

public void SetDialogIndex(int index)

Parameters

index int

The index to set. Use -1 to reset to beginning.