PixelCrushers.DialogueSystem.ConversationController Class Reference

Mediates between a ConversationModel (data) and ConversationView (user interface) to run a conversation. More...

Public Member Functions

delegate void EndConversationDelegate (ConversationController ConversationController)
 
 ConversationController (ConversationModel model, ConversationView view, bool alwaysForceResponseMenu, EndConversationDelegate endConversationHandler)
 Initializes a new ConversationController and starts the conversation in the model. More...
 
void Close ()
 Closes the currently-running conversation, which also sends OnConversationEnd messages to the participants. More...
 
void GotoState (ConversationState state)
 Goes to a conversation state. More...
 
void GotoFirstResponse ()
 Follows the first PC response in the current state. More...
 
void GotoRandomResponse ()
 Follows a random PC response in the current state. More...
 
void UpdateResponses ()
 
void SetActorPortraitTexture (string actorName, Texture2D portraitTexture)
 Sets the portrait texture to use in the UI for an actor. More...
 

Properties

bool IsActive [get]
 Indicates whether the ConversationController is currently running a conversation. More...
 
CharacterInfoActorInfo [get]
 Gets the actor info for this conversation. More...
 
ConversationModel ConversationModel [get]
 
ConversationView ConversationView [get]
 
IsDialogueEntryValidDelegate IsDialogueEntryValid [get, set]
 Gets or sets the IsDialogueEntryValid delegate. More...
 
CharacterInfoConversantInfo [get]
 Gets the conversant info for this conversation. More...
 

Detailed Description

Mediates between a ConversationModel (data) and ConversationView (user interface) to run a conversation.

Constructor & Destructor Documentation

◆ ConversationController()

PixelCrushers.DialogueSystem.ConversationController.ConversationController ( ConversationModel  model,
ConversationView  view,
bool  alwaysForceResponseMenu,
EndConversationDelegate  endConversationHandler 
)

Initializes a new ConversationController and starts the conversation in the model.

Also sends OnConversationStart messages to the participants.

Parameters
modelData model of the conversation.
viewView to use to provide a user interface for the conversation.
endConversationHandlerHandler to call to inform when the conversation is done.

Member Function Documentation

◆ Close()

void PixelCrushers.DialogueSystem.ConversationController.Close ( )

Closes the currently-running conversation, which also sends OnConversationEnd messages to the participants.

◆ EndConversationDelegate()

delegate void PixelCrushers.DialogueSystem.ConversationController.EndConversationDelegate ( ConversationController  ConversationController)

◆ GotoFirstResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoFirstResponse ( )

Follows the first PC response in the current state.

◆ GotoRandomResponse()

void PixelCrushers.DialogueSystem.ConversationController.GotoRandomResponse ( )

Follows a random PC response in the current state.

◆ GotoState()

void PixelCrushers.DialogueSystem.ConversationController.GotoState ( ConversationState  state)

Goes to a conversation state.

If the state is null, the conversation ends.

Parameters
stateState.

◆ SetActorPortraitTexture()

void PixelCrushers.DialogueSystem.ConversationController.SetActorPortraitTexture ( string  actorName,
Texture2D  portraitTexture 
)

Sets the portrait texture to use in the UI for an actor.

This is used when the SetPortrait() sequencer command changes an actor's image.

Parameters
actorNameActor name.
portraitTexturePortrait texture.

◆ UpdateResponses()

void PixelCrushers.DialogueSystem.ConversationController.UpdateResponses ( )

Property Documentation

◆ ActorInfo

CharacterInfo? PixelCrushers.DialogueSystem.ConversationController.ActorInfo
get

Gets the actor info for this conversation.

The actor info.

◆ ConversantInfo

CharacterInfo? PixelCrushers.DialogueSystem.ConversationController.ConversantInfo
get

Gets the conversant info for this conversation.

The conversant info.

◆ ConversationModel

ConversationModel PixelCrushers.DialogueSystem.ConversationController.ConversationModel
get

◆ ConversationView

ConversationView PixelCrushers.DialogueSystem.ConversationController.ConversationView
get

◆ IsActive

bool PixelCrushers.DialogueSystem.ConversationController.IsActive
get

Indicates whether the ConversationController is currently running a conversation.

true if a conversation is active; false if the conversation is done.

◆ IsDialogueEntryValid

IsDialogueEntryValidDelegate PixelCrushers.DialogueSystem.ConversationController.IsDialogueEntryValid
getset

Gets or sets the IsDialogueEntryValid delegate.


The documentation for this class was generated from the following file: