Class Conversation
- Namespace
- WitShells.DialogsManager
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
CurrentDialog
Gets the current dialog without advancing.
public DialogObject CurrentDialog { get; }
Property Value
CurrentDialogIndex
The current dialog index (0-based). Returns -1 if not started.
public int CurrentDialogIndex { get; }
Property Value
Description
Optional description for this conversation.
public string Description { get; set; }
Property Value
Dialogs
The array of dialogs in this conversation.
public DialogObject[] Dialogs { get; }
Property Value
HasStarted
Whether the conversation has been started.
public bool HasStarted { get; }
Property Value
IsAtLastDialog
Whether the conversation is at the last dialog.
public bool IsAtLastDialog { get; }
Property Value
Loop
Whether the conversation will loop.
public bool Loop { get; set; }
Property Value
TotalDialogs
The total number of dialogs in this conversation.
public int TotalDialogs { get; }
Property Value
Methods
GetDialogAt(int)
Gets a dialog at a specific index without changing the current index.
public DialogObject GetDialogAt(int index)
Parameters
indexintThe 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
GetTotalAudioDuration()
Gets the total duration of all audio clips in the conversation.
public float GetTotalAudioDuration()
Returns
HasMoreDialogs()
Whether there are more dialogs to play.
public bool HasMoreDialogs()
Returns
ResetConversation()
Resets the conversation to the beginning.
public void ResetConversation()
SetDialogIndex(int)
Sets the current dialog index.
public void SetDialogIndex(int index)
Parameters
indexintThe index to set. Use -1 to reset to beginning.