Class DialogueManagerBase<ChoiceButtonT>
Inheritance
DialogueManagerBase<ChoiceButtonT>
Assembly: cs.temp.dll.dll
Syntax
public abstract class DialogueManagerBase<ChoiceButtonT> : MonoBehaviour where ChoiceButtonT : Component
Type Parameters
Name |
Description |
ChoiceButtonT |
|
Fields
Declaration
protected List<DialogueManagerBase<ChoiceButtonT>.ChoiceButtonHandle> _choiceButtonInstances
Field Value
_currentConversation
Declaration
protected Conversation _currentConversation
Field Value
Type |
Description |
Conversation |
|
_lineIndex
Declaration
Field Value
_linePlaying
Declaration
protected bool _linePlaying
Field Value
Declaration
protected ChoiceButtonT choiceButton
Field Value
Type |
Description |
ChoiceButtonT |
|
Declaration
protected Transform choiceButtonHolder
Field Value
Type |
Description |
Transform |
|
nameText
Declaration
protected TextMeshProUGUI nameText
Field Value
Type |
Description |
TextMeshProUGUI |
|
Declaration
protected float scrollSpeed
Field Value
sentenceText
Declaration
protected TextMeshProUGUI sentenceText
Field Value
Type |
Description |
TextMeshProUGUI |
|
speakerPortrait
Declaration
protected Image speakerPortrait
Field Value
Properties
OnConversationEnd
Declaration
public UnityEvent OnConversationEnd { get; set; }
Property Value
Type |
Description |
UnityEvent |
|
OnConversationStart
Declaration
public UnityEvent OnConversationStart { get; set; }
Property Value
Type |
Description |
UnityEvent |
|
ParsedConversations
Declaration
public List<Conversation> ParsedConversations { get; protected set; }
Property Value
Type |
Description |
List<Conversation> |
|
Methods
Declaration
protected virtual void ClearChoiceButton(DialogueManagerBase<ChoiceButtonT>.ChoiceButtonHandle buttonHandle)
Parameters
ClearDialogueBox()
Clears all text and Images in the dialogue box.
Declaration
protected virtual void ClearDialogueBox()
Declaration
protected virtual ChoiceButtonT CreateChoiceButton()
Returns
Type |
Description |
ChoiceButtonT |
|
DisplayChoices()
Uses the Unity UI system and TextMeshPro to render choice buttons.
Declaration
protected void DisplayChoices()
DisplayDialogue()
Declaration
protected virtual IEnumerator DisplayDialogue()
Returns
Type |
Description |
IEnumerator |
|
DisplaySpeakerImage()
Sets the speaker image and makes the Image transparent if there is no speaker image.
Declaration
protected void DisplaySpeakerImage()
GetDialogueMethods()
Gets all methods for the current assembly, other specified assemblies, or all assemblies, and checks them against the
DialogueFunction attribute.
Declaration
protected IEnumerable<MethodInfo> GetDialogueMethods()
Returns
Type |
Description |
IEnumerable<MethodInfo> |
|
InvokeFunctions(Dictionary<Int32, String>)
Looks for functions and invokes them in a given line. The function also handles multiple return types and the parameters passed in.
Declaration
protected virtual void InvokeFunctions(Dictionary<int, string> functionInvocations)
Parameters
Type |
Name |
Description |
Dictionary<Int32, String> |
functionInvocations |
The invocations inside the current line being displayed.
|
JumpTo(String)
Jumps to a given conversation in the dialogue by using its name.
Declaration
public void JumpTo(string conversationName)
Parameters
Type |
Name |
Description |
String |
conversationName |
Name as seen in the DialogueAsset
|
Declaration
protected abstract void PrepareChoiceButton(DialogueManagerBase<ChoiceButtonT>.ChoiceButtonHandle handle, Choice choice)
Parameters
Declaration
protected virtual void RemoveChoiceButton(DialogueManagerBase<ChoiceButtonT>.ChoiceButtonHandle buttonHandle)
Parameters
StartConversation(DialogueAsset, Int32)
Starts a dialogue by parsing all the text in a file, clearing the dialogue box and starting the DisplayDialogue() function.
Declaration
public void StartConversation(DialogueAsset interactionDialogue, int startIndex = 0)
Parameters
Type |
Name |
Description |
DialogueAsset |
interactionDialogue |
The dialogue file that we want to use in the conversation
|
Int32 |
startIndex |
The index of the conversation you want to start.
|
StopConversation()
Stops the currently playing conversation and clears the dialogue box.
Declaration
public void StopConversation()
TryDisplayNextLine()
Clears the dialogue box and displays the next line if no sentences are left in the
current one.
Declaration
public void TryDisplayNextLine()