PixelCrushers.DialogueSystem.DialogueManager Class Reference

A static class that provides a simplified interface to the Dialogue System's core functions. More...

Static Public Member Functions

static void SetLanguage (string language)
 Sets the language to use for localized text.
 
static void SetDialogueSystemInput (bool value)
 Enables or disables Dialogue System input.
 
static bool IsDialogueSystemInputDisabled ()
 Returns true if Dialogue System input is disabled.
 
static void AddDatabase (DialogueDatabase database)
 Adds a dialogue database to memory.
 
static void RemoveDatabase (DialogueDatabase database)
 Removes a dialogue database from memory.
 
static void ResetDatabase (DatabaseResetOptions databaseResetOptions)
 Resets the database to a default state.
 
static void ResetDatabase ()
 Resets the database to a default state, keeping all loaded databases.
 
static void PreloadMasterDatabase ()
 Preloads the master database.
 
static void PreloadDialogueUI ()
 Preloads the dialogue UI.
 
static bool ConversationHasValidEntry (string title, Transform actor, Transform conversant, int initialDialogueEntryID=-1)
 Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.
 
static bool ConversationHasValidEntry (string title, Transform actor)
 Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.
 
static bool ConversationHasValidEntry (string title)
 Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.
 
static string GetConversationTitle (int conversationID)
 Returns a conversation title given its ID, or empty string if no conversation has the ID.
 
static void StartConversation (string title, Transform actor, Transform conversant, int initialDialogueEntryID, IDialogueUI overrideDialogueUI)
 Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.
 
static void StartConversation (string title, Transform actor, Transform conversant, int initialDialogueEntryID)
 Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.
 
static void StartConversation (string title, Transform actor, Transform conversant)
 Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.
 
static void StartConversation (string title, Transform actor)
 Starts a conversation, which also broadcasts an OnConversationStart message to the actor.
 
static void StartConversation (string title)
 Starts the conversation with no transforms specified for the actor or conversant.
 
static void StopConversation ()
 Stop the current conversation immediately, and sends an OnConversationEnd message to the actor and conversant.
 
static void StopAllConversations ()
 Stops all current conversations immediately.
 
static void UpdateResponses ()
 Updates the responses for the current state of the current conversation.
 
static void SetContinueMode (bool value)
 Sets continue button mode to Always (true) or Never (false).
 
static void SetContinueMode (DisplaySettings.SubtitleSettings.ContinueButtonMode mode)
 Sets continue button mode.
 
static void SetOriginalContinueMode ()
 Reverts continue button mode to the previously-saved mode.
 
static void ChangeActorName (string actorName, string newDisplayName)
 Changes an actor's Display Name.
 
static void Bark (string conversationTitle, Transform speaker, Transform listener, BarkHistory barkHistory)
 Causes a character to bark a line at another character.
 
static void Bark (string conversationTitle, Transform speaker, Transform listener, int entryID)
 Causes a character to bark a line at another character.
 
static void Bark (string conversationTitle, Transform speaker, Transform listener)
 Causes a character to bark a line at another character.
 
static void Bark (string conversationTitle, Transform speaker)
 Causes a character to bark a line.
 
static void Bark (string conversationTitle, Transform speaker, BarkHistory barkHistory)
 Causes a character to bark a line.
 
static void BarkString (string barkText, Transform speaker, Transform listener=null, string sequence=null)
 Causes a character to bark a literal string instead of looking up its line from a conversation.
 
static float GetBarkDuration (string barkText)
 Returns the default duration that a string of bark text will be shown.
 
static void ShowAlert (string message, float duration)
 Shows an alert message using the dialogue UI.
 
static void ShowAlert (string message)
 Shows an alert message using the dialogue UI for the UI's default duration.
 
static void CheckAlerts ()
 Checks Lua Variable['Alert'] to see if we need to show an alert.
 
static void HideAlert ()
 Hides the currently-displaying alert message.
 
static void HideAllAlerts ()
 Hides the currently-displaying alert message and clears any pending queued alerts.
 
static string GetLocalizedText (string s)
 Gets localized text.
 
static Sequencer PlaySequence (string sequence, Transform speaker, Transform listener, bool informParticipants, bool destroyWhenDone, string entrytag)
 Starts a sequence.
 
static Sequencer PlaySequence (string sequence, Transform speaker, Transform listener, bool informParticipants, bool destroyWhenDone)
 Starts a sequence.
 
static Sequencer PlaySequence (string sequence, Transform speaker, Transform listener, bool informParticipants)
 Starts a sequence.
 
static Sequencer PlaySequence (string sequence, Transform speaker, Transform listener)
 Starts a sequence, and sends OnSequenceStart/OnSequenceEnd messages to the participants.
 
static Sequencer PlaySequence (string sequence)
 Starts a sequence.
 
static void StopSequence (Sequencer sequencer)
 Stops a sequence.
 
static void Pause ()
 Pauses the Dialogue System.
 
static void Unpause ()
 Unpauses the Dialogue System.
 
static void UseDialogueUI (GameObject gameObject)
 Sets the dialogue UI.
 
static void SetDialoguePanel (bool show, bool immediate=false)
 Sets the dialogue UI's main panel visible or invisible.
 
static void SetPortrait (string actorName, string portraitName)
 Sets an actor's portrait.
 
static void AddLuaObserver (string luaExpression, LuaWatchFrequency frequency, LuaChangedDelegate luaChangedHandler)
 Adds a Lua expression observer.
 
static void RemoveLuaObserver (string luaExpression, LuaWatchFrequency frequency, LuaChangedDelegate luaChangedHandler)
 Removes a Lua expression observer.
 
static void RemoveAllObservers (LuaWatchFrequency frequency)
 Removes all Lua expression observers for a specified frequency.
 
static void RemoveAllObservers ()
 Removes all Lua expression observers.
 
static void RegisterAssetBundle (AssetBundle bundle)
 Registers an asset bundle with the Dialogue System.
 
static void UnregisterAssetBundle (AssetBundle bundle)
 Unregisters an asset bundle from the Dialogue System.
 
static UnityEngine.Object LoadAsset (string name)
 Loads a named asset from the registered asset bundles or from Resources.
 
static UnityEngine.Object LoadAsset (string name, System.Type type)
 Loads a named asset from the registered asset bundles or from Resources.
 
static void LoadAsset (string name, System.Type type, AssetLoadedDelegate assetLoaded)
 Loads a named asset from the registered asset bundles, Resources, or Addressables.
 
static void UnloadAsset (object obj)
 Unloads an object previously loaded by LoadAsset.
 
static void SendUpdateTracker ()
 Sends an "UpdateTracker" message to the Dialogue Manager, which may have a quest tracker component that listens for this message,.
 

Properties

static DialogueSystemController instance [get]
 Gets the instance of DialogueSystemController.
 
static bool hasInstance [get]
 Returns true if the singleton has found or created an instance.
 
static DatabaseManager databaseManager [get]
 Gets the database manager.
 
static DialogueDatabase masterDatabase [get]
 Gets the master database.
 
static IDialogueUI dialogueUI [get, set]
 Gets the dialogue UI.
 
static StandardDialogueUI standardDialogueUI [get, set]
 Convenience property that casts the dialogueUI property as a StandardDialogueUI.
 
static DisplaySettings displaySettings [get]
 Gets the display settings.
 
static bool isConversationActive [get]
 Indicates whether a conversation is active.
 
static bool allowSimultaneousConversations [get]
 Indicates whether more than one conversation can play at the same time.
 
static bool interruptActiveConversations [get]
 If not allowing simultaneous conversations and a conversation is active, stop it if another conversation wants to start.
 
static IsDialogueEntryValidDelegate isDialogueEntryValid [get, set]
 The IsDialogueEntryValid delegate (if one is assigned).
 
static System.Action customResponseTimeoutHandler [get, set]
 If response timeout action is set to Custom and menu times out, call this method.
 
static GetInputButtonDownDelegate getInputButtonDown [get, set]
 The GetInputButtonDown delegate.
 
static Transform currentActor [get]
 Gets the current actor in the last conversation started (or null if no conversation is active or the last conversation started has ended).
 
static Transform currentConversant [get]
 Gets the current conversant in the last conversation started (or null if no conversation is active or the last conversation started has ended).
 
static ConversationState currentConversationState [get]
 Gets the current conversation state of the last conversation started (or null if no conversation is active or the last conversation started has ended).
 
static string lastConversationStarted [get]
 Gets the title of the last conversation started.
 
static string lastConversationEnded [get]
 Gets the title of the last conversation that ended.
 
static int lastConversationID [get]
 Gets the ID of the last conversation started.
 
static ConversationController conversationController [get]
 Gets the active conversation's ConversationController.
 
static ConversationModel conversationModel [get]
 Gets the active conversation's ConversationModel.
 
static ConversationView conversationView [get]
 Gets the active conversation's ConversationView.
 
static bool onStartTriggerWaitForSaveDataApplied [get, set]
 If true, Dialogue System Triggers set to OnStart should wait until save data has been applied or variables initialized.
 
static DialogueDebug.DebugLevel debugLevel [get, set]
 Gets or sets the debug level.
 
static bool allowLuaExceptions [get, set]
 Gets or sets a value indicating whether exceptions in Lua code will be caught by the calling method or allowed to rise up to Unity.
 

Detailed Description

A static class that provides a simplified interface to the Dialogue System's core functions.

This class manages a singleton instance of DialogueSystemController. Starting in version 2.0, it will NOT auto-instantiate an instance if none exists.

Member Function Documentation

◆ AddDatabase()

static void PixelCrushers.DialogueSystem.DialogueManager.AddDatabase ( DialogueDatabase  database)
inlinestatic

Adds a dialogue database to memory.

To save memory or reduce load time, you may want to break up your dialogue data into multiple smaller databases. You can add or remove these databases as needed.

Parameters
databaseThe database to add.

◆ AddLuaObserver()

static void PixelCrushers.DialogueSystem.DialogueManager.AddLuaObserver ( string  luaExpression,
LuaWatchFrequency  frequency,
LuaChangedDelegate  luaChangedHandler 
)
inlinestatic

Adds a Lua expression observer.

Parameters
luaExpressionLua expression to watch.
frequencyFrequency to check the expression.
luaChangedHandlerDelegate to call when the expression changes. This should be in the form:
void MyDelegate(LuaWatchItem luaWatchItem, Lua.Result newValue) {...}
A static class that provides a global Lua virtual machine.
Definition Lua.cs:18
Watch item for Lua observers.
Definition LuaWatchItem.cs:17
Stores a Lua interpreter result (LuaValue) and provides easy conversion to basic types.
Definition Lua.cs:24

◆ Bark() [1/5]

static void PixelCrushers.DialogueSystem.DialogueManager.Bark ( string  conversationTitle,
Transform  speaker 
)
inlinestatic

Causes a character to bark a line.

A bark is a line spoken outside of a full conversation. It uses a simple gameplay bark UI instead of the dialogue UI. Since this form of the Bark() method does not include a BarkHistory, a random bark is selected from the bark lines.

Parameters
conversationTitleTitle of the conversation that contains the bark lines. In this conversation, all dialogue entries linked from the first entry are considered bark lines.
speakerThe character barking the line.

◆ Bark() [2/5]

static void PixelCrushers.DialogueSystem.DialogueManager.Bark ( string  conversationTitle,
Transform  speaker,
BarkHistory  barkHistory 
)
inlinestatic

Causes a character to bark a line.

A bark is a line spoken outside of a full conversation. It uses a simple gameplay bark UI instead of the dialogue UI.

Parameters
conversationTitleTitle of the conversation that contains the bark lines. In this conversation, all dialogue entries linked from the first entry are considered bark lines.
speakerThe character barking the line.
barkHistoryBark history used to track the most recent bark, so the bark controller can go through the bark lines in a specified order.

◆ Bark() [3/5]

static void PixelCrushers.DialogueSystem.DialogueManager.Bark ( string  conversationTitle,
Transform  speaker,
Transform  listener 
)
inlinestatic

Causes a character to bark a line at another character.

A bark is a line spoken outside of a full conversation. It uses a simple gameplay bark UI instead of the dialogue UI. Since this form of the Bark() method does not include a BarkHistory, a random bark is selected from the bark lines.

Parameters
conversationTitleTitle of the conversation that contains the bark lines. In this conversation, all dialogue entries linked from the first entry are considered bark lines.
speakerThe character barking the line.
listenerThe character being barked at.

◆ Bark() [4/5]

static void PixelCrushers.DialogueSystem.DialogueManager.Bark ( string  conversationTitle,
Transform  speaker,
Transform  listener,
BarkHistory  barkHistory 
)
inlinestatic

Causes a character to bark a line at another character.

A bark is a line spoken outside of a full conversation. It uses a simple gameplay bark UI instead of the dialogue UI.

Parameters
conversationTitleTitle of the conversation that contains the bark lines. In this conversation, all dialogue entries linked from the first entry are considered bark lines.
speakerThe character barking the line.
listenerThe character being barked at.
barkHistoryBark history used to track the most recent bark, so the bark controller can go through the bark lines in a specified order.

◆ Bark() [5/5]

static void PixelCrushers.DialogueSystem.DialogueManager.Bark ( string  conversationTitle,
Transform  speaker,
Transform  listener,
int  entryID 
)
inlinestatic

Causes a character to bark a line at another character.

A bark is a line spoken outside of a full conversation. It uses a simple gameplay bark UI instead of the dialogue UI.

Parameters
conversationTitleTitle of the conversation that contains the bark lines. In this conversation, all dialogue entries linked from the first entry are considered bark lines.
speakerThe character barking the line.
listenerThe character being barked at.
entryIDDialogue entry ID to bark.

◆ BarkString()

static void PixelCrushers.DialogueSystem.DialogueManager.BarkString ( string  barkText,
Transform  speaker,
Transform  listener = null,
string  sequence = null 
)
inlinestatic

Causes a character to bark a literal string instead of looking up its line from a conversation.

Parameters
barkTextThe string to bark.
speakerThe barker.
listenerThe target of the bark. (May be null)
sequenceThe optional sequence to play. (May be null or empty)

◆ ChangeActorName()

static void PixelCrushers.DialogueSystem.DialogueManager.ChangeActorName ( string  actorName,
string  newDisplayName 
)
inlinestatic

Changes an actor's Display Name.

Parameters
actorNameActor's Name field.
newDisplayNameNew Display Name value.

◆ CheckAlerts()

static void PixelCrushers.DialogueSystem.DialogueManager.CheckAlerts ( )
inlinestatic

Checks Lua Variable['Alert'] to see if we need to show an alert.

◆ ConversationHasValidEntry() [1/3]

static bool PixelCrushers.DialogueSystem.DialogueManager.ConversationHasValidEntry ( string  title)
inlinestatic

Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.

Returns
true, if the conversation has a valid entry, false otherwise.
Parameters
titleThe title of the conversation to look up in the master database.

◆ ConversationHasValidEntry() [2/3]

static bool PixelCrushers.DialogueSystem.DialogueManager.ConversationHasValidEntry ( string  title,
Transform  actor 
)
inlinestatic

Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.

Returns
true, if the conversation has a valid entry, false otherwise.
Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.

◆ ConversationHasValidEntry() [3/3]

static bool PixelCrushers.DialogueSystem.DialogueManager.ConversationHasValidEntry ( string  title,
Transform  actor,
Transform  conversant,
int  initialDialogueEntryID = -1 
)
inlinestatic

Checks whether a conversation has any valid entries linked from the start entry, since it's possible that the conditions of all entries could be false.

Returns
true, if the conversation has a valid entry, false otherwise.
Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.
conversantThe transform of the conversant (the other participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the conversant is usually the NPC.
initialDialogueEntryIDOptional starting entry ID; omit to start at beginning.

◆ GetBarkDuration()

static float PixelCrushers.DialogueSystem.DialogueManager.GetBarkDuration ( string  barkText)
inlinestatic

Returns the default duration that a string of bark text will be shown.

Parameters
barkTextThe text that will be barked (to determine the duration).
Returns
The default duration in seconds for the specified bark text.

◆ GetConversationTitle()

static string PixelCrushers.DialogueSystem.DialogueManager.GetConversationTitle ( int  conversationID)
inlinestatic

Returns a conversation title given its ID, or empty string if no conversation has the ID.

◆ GetLocalizedText()

static string PixelCrushers.DialogueSystem.DialogueManager.GetLocalizedText ( string  s)
inlinestatic

Gets localized text.

Returns
If the specified field exists in the text tables, returns the field's localized text for the current language. Otherwise returns the field itself.
Parameters
sThe field to look up.

◆ HideAlert()

static void PixelCrushers.DialogueSystem.DialogueManager.HideAlert ( )
inlinestatic

Hides the currently-displaying alert message.

◆ HideAllAlerts()

static void PixelCrushers.DialogueSystem.DialogueManager.HideAllAlerts ( )
inlinestatic

Hides the currently-displaying alert message and clears any pending queued alerts.

◆ IsDialogueSystemInputDisabled()

static bool PixelCrushers.DialogueSystem.DialogueManager.IsDialogueSystemInputDisabled ( )
inlinestatic

Returns true if Dialogue System input is disabled.

Returns

◆ LoadAsset() [1/3]

static UnityEngine.Object PixelCrushers.DialogueSystem.DialogueManager.LoadAsset ( string  name)
inlinestatic

Loads a named asset from the registered asset bundles or from Resources.

Note: This version now also works with Addressables, and works synchronously.

Returns
The asset, or null if not found.
Parameters
nameName of the asset.

◆ LoadAsset() [2/3]

static UnityEngine.Object PixelCrushers.DialogueSystem.DialogueManager.LoadAsset ( string  name,
System::Type  type 
)
inlinestatic

Loads a named asset from the registered asset bundles or from Resources.

Note: This version now also works with Addressables, and works synchronously.

Returns
The asset, or null if not found.
Parameters
nameName of the asset.
typeType of the asset.

◆ LoadAsset() [3/3]

static void PixelCrushers.DialogueSystem.DialogueManager.LoadAsset ( string  name,
System::Type  type,
AssetLoadedDelegate  assetLoaded 
)
inlinestatic

Loads a named asset from the registered asset bundles, Resources, or Addressables.

Returns the asset in a callback delegate. Addressables will be unloaded when the scene is unloaded. To unload them earlier, use DialogueManager.UnloadAsset().

By default, scene changes unload all addressables loaded via DialogueManager.LoadAsset(). To prevent the unload, set DialogueManager.instance.unloadAddressablesOnSceneChange to false.

Parameters
nameName of the asset.
typeType of the asset
assetLoadedDelegate method to call when returning loaded asset, or null if not found.

◆ Pause()

static void PixelCrushers.DialogueSystem.DialogueManager.Pause ( )
inlinestatic

Pauses the Dialogue System.

Also broadcasts OnDialogueSystemPause to the Dialogue Manager and conversation participants. Conversations, timers, typewriter and fade effects, and the AudioWait() and Voice() sequencer commands will be paused. Other than this, AudioSource, Animation, and Animator components will not be paused; it's up to you to handle them as appropriate for your project.

◆ PlaySequence() [1/5]

static Sequencer PixelCrushers.DialogueSystem.DialogueManager.PlaySequence ( string  sequence)
inlinestatic

Starts a sequence.

See sequencer.

Returns
The sequencer that is playing the sequence.
Parameters
sequenceThe sequence to play.

◆ PlaySequence() [2/5]

static Sequencer PixelCrushers.DialogueSystem.DialogueManager.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener 
)
inlinestatic

Starts a sequence, and sends OnSequenceStart/OnSequenceEnd messages to the participants.

See sequencer.

Returns
The sequencer that is playing the sequence.
Parameters
sequenceThe sequence to play.
speakerThe speaker, for sequence commands that reference the speaker.
listenerThe listener, for sequence commands that reference the listener.

◆ PlaySequence() [3/5]

static Sequencer PixelCrushers.DialogueSystem.DialogueManager.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants 
)
inlinestatic

Starts a sequence.

See sequencer.

Returns
The sequencer that is playing the sequence.
Parameters
sequenceThe sequence to play.
speakerThe speaker, for sequence commands that reference the speaker.
listenerThe listener, for sequence commands that reference the listener.
informParticipantsSpecifies whether to send OnSequenceStart and OnSequenceEnd messages to the speaker and listener. Default is true.

◆ PlaySequence() [4/5]

static Sequencer PixelCrushers.DialogueSystem.DialogueManager.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants,
bool  destroyWhenDone 
)
inlinestatic

Starts a sequence.

See sequencer.

Returns
The sequencer that is playing the sequence.
Parameters
sequenceThe sequence to play.
speakerThe speaker, for sequence commands that reference the speaker.
listenerThe listener, for sequence commands that reference the listener.
informParticipantsSpecifies whether to send OnSequenceStart and OnSequenceEnd messages to the speaker and listener. Default is true.
destroyWhenDoneSpecifies whether destroy the sequencer when done playing the sequence. Default is true.

◆ PlaySequence() [5/5]

static Sequencer PixelCrushers.DialogueSystem.DialogueManager.PlaySequence ( string  sequence,
Transform  speaker,
Transform  listener,
bool  informParticipants,
bool  destroyWhenDone,
string  entrytag 
)
inlinestatic

Starts a sequence.

See sequencer.

Parameters
sequenceThe sequence to play.
speakerThe speaker, for sequence commands that reference the speaker.
listenerThe listener, for sequence commands that reference the listener.
informParticipantsSpecifies whether to send OnSequenceStart and OnSequenceEnd messages to the speaker and listener. Default is true.
destroyWhenDoneSpecifies whether destroy the sequencer when done playing the sequence. Default is
entrytagThe entrytag to associate with the sequence.
Returns
The sequencer that is playing the sequence.

◆ PreloadDialogueUI()

static void PixelCrushers.DialogueSystem.DialogueManager.PreloadDialogueUI ( )
inlinestatic

Preloads the dialogue UI.

The Dialogue System delays loading of the dialogue UI until the first time it's needed for a conversation or alert. Since dialogue UIs often contain textures and other art assets, loading can cause a slight pause. You may want to preload the UI at a time of your design by using this method.

◆ PreloadMasterDatabase()

static void PixelCrushers.DialogueSystem.DialogueManager.PreloadMasterDatabase ( )
inlinestatic

Preloads the master database.

The Dialogue System delays loading of the dialogue database until the data is needed. This avoids potentially long delays during Start(). If you want to load the database manually (for example to run Lua commands on its contents), call this method.

◆ RegisterAssetBundle()

static void PixelCrushers.DialogueSystem.DialogueManager.RegisterAssetBundle ( AssetBundle  bundle)
inlinestatic

Registers an asset bundle with the Dialogue System.

This allows sequencer commands to load assets inside it.

Parameters
bundleAsset bundle.

◆ RemoveAllObservers() [1/2]

static void PixelCrushers.DialogueSystem.DialogueManager.RemoveAllObservers ( )
inlinestatic

Removes all Lua expression observers.

◆ RemoveAllObservers() [2/2]

static void PixelCrushers.DialogueSystem.DialogueManager.RemoveAllObservers ( LuaWatchFrequency  frequency)
inlinestatic

Removes all Lua expression observers for a specified frequency.

Parameters
frequencyFrequency.

◆ RemoveDatabase()

static void PixelCrushers.DialogueSystem.DialogueManager.RemoveDatabase ( DialogueDatabase  database)
inlinestatic

Removes a dialogue database from memory.

To save memory or reduce load time, you may want to break up your dialogue data into multiple smaller databases. You can add or remove these databases as needed.

Parameters
databaseThe database to remove.

◆ RemoveLuaObserver()

static void PixelCrushers.DialogueSystem.DialogueManager.RemoveLuaObserver ( string  luaExpression,
LuaWatchFrequency  frequency,
LuaChangedDelegate  luaChangedHandler 
)
inlinestatic

Removes a Lua expression observer.

To be removed, the expression, frequency, and notification delegate must all match.

Parameters
luaExpressionLua expression being watched.
frequencyFrequency that the expression is being watched.
luaChangedHandlerDelegate that's called when the expression changes.

◆ ResetDatabase() [1/2]

static void PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase ( )
inlinestatic

Resets the database to a default state, keeping all loaded databases.

◆ ResetDatabase() [2/2]

static void PixelCrushers.DialogueSystem.DialogueManager.ResetDatabase ( DatabaseResetOptions  databaseResetOptions)
inlinestatic

Resets the database to a default state.

Parameters
databaseResetOptionsAccepts the following values:
  • RevertToDefault: Restores the default database, removing any other databases that were added after startup.
  • KeepAllLoaded: Keeps all loaded databases in memory, but reverts them to their starting values.

◆ SendUpdateTracker()

static void PixelCrushers.DialogueSystem.DialogueManager.SendUpdateTracker ( )
inlinestatic

Sends an "UpdateTracker" message to the Dialogue Manager, which may have a quest tracker component that listens for this message,.

◆ SetContinueMode() [1/2]

static void PixelCrushers.DialogueSystem.DialogueManager.SetContinueMode ( bool  value)
inlinestatic

Sets continue button mode to Always (true) or Never (false).

Before changing, records current mode so you can use SetOriginalContinueMode() to revert the setting.

◆ SetContinueMode() [2/2]

static void PixelCrushers.DialogueSystem.DialogueManager.SetContinueMode ( DisplaySettings::SubtitleSettings::ContinueButtonMode  mode)
inlinestatic

Sets continue button mode.

Before changing, records current mode so you can use SetOriginalContinueMode() to revert the setting.

◆ SetDialoguePanel()

static void PixelCrushers.DialogueSystem.DialogueManager.SetDialoguePanel ( bool  show,
bool  immediate = false 
)
inlinestatic

Sets the dialogue UI's main panel visible or invisible.

Parameters
showIf true, show (or re-show) the panel; if false, hide it.
immediateIf true, skip animation and change immediately.

◆ SetDialogueSystemInput()

static void PixelCrushers.DialogueSystem.DialogueManager.SetDialogueSystemInput ( bool  value)
inlinestatic

Enables or disables Dialogue System input.

Parameters
valueTrue to enable, false to disable.

◆ SetLanguage()

static void PixelCrushers.DialogueSystem.DialogueManager.SetLanguage ( string  language)
inlinestatic

Sets the language to use for localized text.

Parameters
languageLanguage to use. Specify null or an emtpy string to use the default language.

◆ SetOriginalContinueMode()

static void PixelCrushers.DialogueSystem.DialogueManager.SetOriginalContinueMode ( )
inlinestatic

Reverts continue button mode to the previously-saved mode.

◆ SetPortrait()

static void PixelCrushers.DialogueSystem.DialogueManager.SetPortrait ( string  actorName,
string  portraitName 
)
inlinestatic

Sets an actor's portrait.

If can be:

  • 'default' or null to use the primary portrait defined in the database,
  • 'pic=#' to use an alternate portrait defined in the database (numbered from 2), or
  • the name of a texture in a Resources folder.
Parameters
actorNameActor name.
portraitNamePortrait name.

◆ ShowAlert() [1/2]

static void PixelCrushers.DialogueSystem.DialogueManager.ShowAlert ( string  message)
inlinestatic

Shows an alert message using the dialogue UI for the UI's default duration.

Parameters
messageThe message to show.

◆ ShowAlert() [2/2]

static void PixelCrushers.DialogueSystem.DialogueManager.ShowAlert ( string  message,
float  duration 
)
inlinestatic

Shows an alert message using the dialogue UI.

Parameters
messageThe message to show.
durationThe duration in seconds to show the message.

◆ StartConversation() [1/5]

static void PixelCrushers.DialogueSystem.DialogueManager.StartConversation ( string  title)
inlinestatic

Starts the conversation with no transforms specified for the actor or conversant.

Parameters
titleThe title of the conversation to look up in the master database.

◆ StartConversation() [2/5]

static void PixelCrushers.DialogueSystem.DialogueManager.StartConversation ( string  title,
Transform  actor 
)
inlinestatic

Starts a conversation, which also broadcasts an OnConversationStart message to the actor.

Your scripts can listen for OnConversationStart to do anything necessary at the beginning of a conversation, such as pausing other gameplay or temporarily disabling player control. See the Feature Demo scene, which uses the SetEnabledOnDialogueEvent component to disable player control during conversations.

Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.

◆ StartConversation() [3/5]

static void PixelCrushers.DialogueSystem.DialogueManager.StartConversation ( string  title,
Transform  actor,
Transform  conversant 
)
inlinestatic

Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.

Your scripts can listen for OnConversationStart to do anything necessary at the beginning of a conversation, such as pausing other gameplay or temporarily disabling player control. See the Feature Demo scene, which uses the SetEnabledOnDialogueEvent component to disable player control during conversations.

Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.
conversantThe transform of the conversant (the other participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the conversant is usually the NPC.

StartConversation("Shopkeeper Conversation", player, shopkeeper);

◆ StartConversation() [4/5]

static void PixelCrushers.DialogueSystem.DialogueManager.StartConversation ( string  title,
Transform  actor,
Transform  conversant,
int  initialDialogueEntryID 
)
inlinestatic

Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.

Your scripts can listen for OnConversationStart to do anything necessary at the beginning of a conversation, such as pausing other gameplay or temporarily disabling player control. See the Feature Demo scene, which uses the SetEnabledOnDialogueEvent component to disable player control during conversations.

Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.
conversantThe transform of the conversant (the other participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the conversant is usually the NPC.
initialDialogueEntryIDThe initial dialogue entry ID, or -1 to start from the beginning.

StartConversation("Shopkeeper Conversation", player, shopkeeper);

◆ StartConversation() [5/5]

static void PixelCrushers.DialogueSystem.DialogueManager.StartConversation ( string  title,
Transform  actor,
Transform  conversant,
int  initialDialogueEntryID,
IDialogueUI  overrideDialogueUI 
)
inlinestatic

Starts a conversation, which also broadcasts an OnConversationStart message to the actor and conversant.

Your scripts can listen for OnConversationStart to do anything necessary at the beginning of a conversation, such as pausing other gameplay or temporarily disabling player control. See the Feature Demo scene, which uses the SetEnabledOnDialogueEvent component to disable player control during conversations.

Parameters
titleThe title of the conversation to look up in the master database.
actorThe transform of the actor (primary participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the actor is usually the PC.
conversantThe transform of the conversant (the other participant). The sequencer uses this to direct camera angles and perform other actions. In PC-NPC conversations, the conversant is usually the NPC.
initialDialogueEntryIDThe initial dialogue entry ID, or -1 to start from the beginning.

StartConversation("Shopkeeper Conversation", player, shopkeeper);

◆ StopAllConversations()

static void PixelCrushers.DialogueSystem.DialogueManager.StopAllConversations ( )
inlinestatic

Stops all current conversations immediately.

◆ StopConversation()

static void PixelCrushers.DialogueSystem.DialogueManager.StopConversation ( )
inlinestatic

Stop the current conversation immediately, and sends an OnConversationEnd message to the actor and conversant.

Your scripts can listen for OnConversationEnd to do anything necessary at the end of a conversation, such as resuming other gameplay or re-enabling player control.

◆ StopSequence()

static void PixelCrushers.DialogueSystem.DialogueManager.StopSequence ( Sequencer  sequencer)
inlinestatic

Stops a sequence.

Parameters
sequencerThe sequencer playing the sequence.

◆ UnloadAsset()

static void PixelCrushers.DialogueSystem.DialogueManager.UnloadAsset ( object  obj)
inlinestatic

Unloads an object previously loaded by LoadAsset.

Only unloads if using addressables.

◆ Unpause()

static void PixelCrushers.DialogueSystem.DialogueManager.Unpause ( )
inlinestatic

Unpauses the Dialogue System.

Also broadcasts OnDialogueSystemUnpause to the Dialogue Manager and conversation participants.

◆ UnregisterAssetBundle()

static void PixelCrushers.DialogueSystem.DialogueManager.UnregisterAssetBundle ( AssetBundle  bundle)
inlinestatic

Unregisters an asset bundle from the Dialogue System.

Always unregister asset bundles before freeing them.

Parameters
bundleAsset bundle.

◆ UpdateResponses()

static void PixelCrushers.DialogueSystem.DialogueManager.UpdateResponses ( )
inlinestatic

Updates the responses for the current state of the current conversation.

If the response menu entries' conditions have changed while the response menu is being shown, you can call this method to update the response menu.

◆ UseDialogueUI()

static void PixelCrushers.DialogueSystem.DialogueManager.UseDialogueUI ( GameObject  gameObject)
inlinestatic

Sets the dialogue UI.

Parameters
gameObjectGame object containing an implementation of IDialogueUI.

Property Documentation

◆ allowLuaExceptions

bool PixelCrushers.DialogueSystem.DialogueManager.allowLuaExceptions
staticgetset

Gets or sets a value indicating whether exceptions in Lua code will be caught by the calling method or allowed to rise up to Unity.

Defaults to false.

true if Lua exceptions are allowed; otherwise, false.

◆ allowSimultaneousConversations

bool PixelCrushers.DialogueSystem.DialogueManager.allowSimultaneousConversations
staticget

Indicates whether more than one conversation can play at the same time.

true if simultaneous conversations are allowed; otherwise, false.

◆ conversationController

ConversationController PixelCrushers.DialogueSystem.DialogueManager.conversationController
staticget

Gets the active conversation's ConversationController.

◆ conversationModel

ConversationModel PixelCrushers.DialogueSystem.DialogueManager.conversationModel
staticget

Gets the active conversation's ConversationModel.

◆ conversationView

ConversationView PixelCrushers.DialogueSystem.DialogueManager.conversationView
staticget

Gets the active conversation's ConversationView.

◆ currentActor

Transform PixelCrushers.DialogueSystem.DialogueManager.currentActor
staticget

Gets the current actor in the last conversation started (or null if no conversation is active or the last conversation started has ended).

See https://www.pixelcrushers.com/dialogue_system/manual2x/html/triggers_and_interaction.html#interactionDialogueSystemTriggerGameObjectAssignments for an explanation of how a conversation's actor and conversant are assigned at runtime.

The actor in the current conversation.

◆ currentConversant

Transform PixelCrushers.DialogueSystem.DialogueManager.currentConversant
staticget

Gets the current conversant in the last conversation started (or null if no conversation is active or the last conversation started has ended).

See https://www.pixelcrushers.com/dialogue_system/manual2x/html/triggers_and_interaction.html#interactionDialogueSystemTriggerGameObjectAssignments for an explanation of how a conversation's actor and conversant are assigned at runtime.

The conversant in the current conversation.

◆ currentConversationState

ConversationState PixelCrushers.DialogueSystem.DialogueManager.currentConversationState
staticget

Gets the current conversation state of the last conversation started (or null if no conversation is active or the last conversation started has ended).

The current conversation state.

◆ customResponseTimeoutHandler

System.Action PixelCrushers.DialogueSystem.DialogueManager.customResponseTimeoutHandler
staticgetset

If response timeout action is set to Custom and menu times out, call this method.

◆ databaseManager

DatabaseManager PixelCrushers.DialogueSystem.DialogueManager.databaseManager
staticget

Gets the database manager.

The database manager.

◆ debugLevel

DialogueDebug.DebugLevel PixelCrushers.DialogueSystem.DialogueManager.debugLevel
staticgetset

Gets or sets the debug level.

The debug level.

◆ dialogueUI

IDialogueUI PixelCrushers.DialogueSystem.DialogueManager.dialogueUI
staticgetset

Gets the dialogue UI.

The dialogue UI.

◆ displaySettings

DisplaySettings PixelCrushers.DialogueSystem.DialogueManager.displaySettings
staticget

Gets the display settings.

The display settings.

◆ getInputButtonDown

GetInputButtonDownDelegate PixelCrushers.DialogueSystem.DialogueManager.getInputButtonDown
staticgetset

The GetInputButtonDown delegate.

Overrides calls to the standard Unity Input.GetButtonDown function.

◆ hasInstance

bool PixelCrushers.DialogueSystem.DialogueManager.hasInstance
staticget

Returns true if the singleton has found or created an instance.

true if has instance; otherwise, false.

◆ instance

DialogueSystemController PixelCrushers.DialogueSystem.DialogueManager.instance
staticget

Gets the instance of DialogueSystemController.

The instance.

◆ interruptActiveConversations

bool PixelCrushers.DialogueSystem.DialogueManager.interruptActiveConversations
staticget

If not allowing simultaneous conversations and a conversation is active, stop it if another conversation wants to start.

true to interrupt active conversation if another wants to start; otherwise, false.

◆ isConversationActive

bool PixelCrushers.DialogueSystem.DialogueManager.isConversationActive
staticget

Indicates whether a conversation is active.

true if a conversation is active; otherwise, false.

◆ isDialogueEntryValid

IsDialogueEntryValidDelegate PixelCrushers.DialogueSystem.DialogueManager.isDialogueEntryValid
staticgetset

The IsDialogueEntryValid delegate (if one is assigned).

This is an optional delegate that you can add to check if a dialogue entry is valid before allowing a conversation to use it. It should return true if the entry is valid.

◆ lastConversationEnded

string PixelCrushers.DialogueSystem.DialogueManager.lastConversationEnded
staticget

Gets the title of the last conversation that ended.

The title of the last conversation ended.

◆ lastConversationID

int PixelCrushers.DialogueSystem.DialogueManager.lastConversationID
staticget

Gets the ID of the last conversation started.

◆ lastConversationStarted

string PixelCrushers.DialogueSystem.DialogueManager.lastConversationStarted
staticget

Gets the title of the last conversation started.

The title of the last conversation started.

◆ masterDatabase

DialogueDatabase PixelCrushers.DialogueSystem.DialogueManager.masterDatabase
staticget

Gets the master database.

The master database.

◆ onStartTriggerWaitForSaveDataApplied

bool PixelCrushers.DialogueSystem.DialogueManager.onStartTriggerWaitForSaveDataApplied
staticgetset

If true, Dialogue System Triggers set to OnStart should wait until save data has been applied or variables initialized.

◆ standardDialogueUI

StandardDialogueUI PixelCrushers.DialogueSystem.DialogueManager.standardDialogueUI
staticgetset

Convenience property that casts the dialogueUI property as a StandardDialogueUI.

If the dialogueUI is not a StandardDialogueUI, returns null.


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