Class DialogUIController
- Namespace
- WitShells.DialogsManager
A base UI controller for displaying dialogs. Extend this class or use it directly for basic dialog UI.
public class DialogUIController : MonoBehaviour
- Inheritance
-
DialogUIController
Fields
advanceAction
protected InputActionReference advanceAction
Field Value
- InputActionReference
clickAction
protected InputActionReference clickAction
Field Value
- InputActionReference
clickToAdvance
protected bool clickToAdvance
Field Value
contentText
protected TMP_Text contentText
Field Value
- TMP_Text
dialogPanel
protected GameObject dialogPanel
Field Value
- GameObject
fullContent
protected string fullContent
Field Value
nextButton
protected Button nextButton
Field Value
- Button
portraitImage
protected Image portraitImage
Field Value
- Image
progressSlider
protected Slider progressSlider
Field Value
- Slider
progressText
protected TMP_Text progressText
Field Value
- TMP_Text
skipAction
protected InputActionReference skipAction
Field Value
- InputActionReference
skipButton
protected Button skipButton
Field Value
- Button
titleText
protected TMP_Text titleText
Field Value
- TMP_Text
typewriterAudioSource
protected AudioSource typewriterAudioSource
Field Value
- AudioSource
typewriterCoroutine
protected Coroutine typewriterCoroutine
Field Value
- Coroutine
typewriterSound
protected AudioClip typewriterSound
Field Value
- AudioClip
typewriterSpeed
protected float typewriterSpeed
Field Value
useTypewriterEffect
protected bool useTypewriterEffect
Field Value
Properties
CurrentDialog
The currently displayed dialog.
public DialogObject CurrentDialog { get; protected set; }
Property Value
IsTyping
Whether the typewriter effect is currently running.
public bool IsTyping { get; protected set; }
Property Value
TypeSpeed
public float TypeSpeed { get; }
Property Value
Methods
AdvanceDialog()
Advances to the next dialog.
public virtual void AdvanceDialog()
Awake()
protected virtual void Awake()
CompleteTypewriter()
protected virtual void CompleteTypewriter()
DisableInputActions()
protected virtual void DisableInputActions()
DisplayDialog(DialogObject, int, Conversation)
Displays a dialog in the UI.
public virtual void DisplayDialog(DialogObject dialog, int index, Conversation conversation)
Parameters
dialogDialogObjectindexintconversationConversation
EnableInputActions()
protected virtual void EnableInputActions()
HideDialogPanel()
Hides the dialog panel.
public virtual void HideDialogPanel()
OnAdvancePerformed(CallbackContext)
protected virtual void OnAdvancePerformed(InputAction.CallbackContext context)
Parameters
contextCallbackContext
OnClickPerformed(CallbackContext)
protected virtual void OnClickPerformed(InputAction.CallbackContext context)
Parameters
contextCallbackContext
OnConversationEnded(ConversationEventArgs)
protected virtual void OnConversationEnded(ConversationEventArgs args)
Parameters
OnConversationStarted(ConversationEventArgs)
protected virtual void OnConversationStarted(ConversationEventArgs args)
Parameters
OnDialogFinished(DialogEventArgs)
protected virtual void OnDialogFinished(DialogEventArgs args)
Parameters
argsDialogEventArgs
OnDialogStarted(DialogEventArgs)
protected virtual void OnDialogStarted(DialogEventArgs args)
Parameters
argsDialogEventArgs
OnDisable()
protected virtual void OnDisable()
OnEnable()
protected virtual void OnEnable()
OnSkipPerformed(CallbackContext)
protected virtual void OnSkipPerformed(InputAction.CallbackContext context)
Parameters
contextCallbackContext
SetupButtons()
protected virtual void SetupButtons()
ShowDialogPanel()
Shows the dialog panel.
public virtual void ShowDialogPanel()
SkipDialog()
Skips the current dialog.
public virtual void SkipDialog()
StartTypewriter(string, float)
protected virtual void StartTypewriter(string text, float speed)
Parameters
StopTypewriter()
protected virtual void StopTypewriter()
SubscribeToEvents()
protected virtual void SubscribeToEvents()
TypewriterCoroutine(string, float)
protected virtual IEnumerator TypewriterCoroutine(string text, float speed)
Parameters
Returns
UnsubscribeFromEvents()
protected virtual void UnsubscribeFromEvents()
UpdateProgress(Conversation)
protected virtual void UpdateProgress(Conversation conversation)
Parameters
conversationConversation