PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI Class Reference

Implements IBarkUI using Unity GUI to show bark text above a character's head. More...

Inheritance diagram for PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI:
Collaboration diagram for PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI:

Public Member Functions

virtual void Awake ()
 
virtual void OnDestroy ()
 
virtual void Bark (Subtitle subtitle)
 Barks a subtitle. More...
 
virtual void Update ()
 Updates the seconds left and hides the label if time is up. More...
 
void OnBarkEnd (Transform actor)
 
void Hide ()
 Hides the currently-playing bark. More...
 

Public Attributes

Transform textPosition
 The absolute text position. More...
 
GUISkin guiSkin
 The GUI skin to use for the bark text. More...
 
string guiStyleName
 The name of the GUI style to use. More...
 
bool includeName
 Set true to include the barker's name in the text. More...
 
float duration = 4f
 The duration in seconds to show the bark text before fading it out. More...
 
float fadeDuration = 0.5f
 The duration in seconds to fade out. More...
 
TextStyle textStyle = TextStyle.Shadow
 The text effect to use for the bark text. More...
 
Color textStyleColor = Color.black
 The color of the text style's outline or shadow. More...
 
BarkSubtitleSetting textDisplaySetting = BarkSubtitleSetting.SameAsDialogueManager
 The text display setting. More...
 
bool waitUntilSequenceEnds = false
 Set true to keep the bark text onscreen until the sequence ends. More...
 
bool checkIfPlayerVisible = true
 Set true to run a raycast to the player. More...
 
LayerMask visibilityLayerMask = 1
 The layer mask to use when checking for player visibility. More...
 

Protected Member Functions

void CheckUnityBarkUIOnGUI ()
 
void CheckPlayerVisibility ()
 
void CheckPlayerCameraTransform ()
 

Protected Attributes

UnityBarkUIOnGUI unityBarkUIOnGUI = null
 
Transform playerCameraTransform = null
 
Collider playerCameraCollider = null
 
float secondsLeft = 0
 

Properties

bool showText [get]
 Indicates whether the bark UI should show the text, based on the textDisplaySetting. More...
 
virtual bool IsPlaying [get]
 Indicates whether a bark is currently playing. More...
 
- Properties inherited from PixelCrushers.DialogueSystem.IBarkUI
bool IsPlaying [get]
 Indicates or sets whether a bark is playing. More...
 

Detailed Description

Implements IBarkUI using Unity GUI to show bark text above a character's head.

For efficiency, this component adds a "child" component called UnityBarkUIOnGUI that contains the OnGUI() method. This allows UnityBarkUI to enable and disable OnGUI() as necessary, since Unity has substantial overhead for every OnGUI() call, even if it exits immediately. If you want to set a text offset, you can add the UnityBarkUIOnGUI manually instead.

Member Function Documentation

◆ Awake()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.Awake ( )
virtual

◆ Bark()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.Bark ( Subtitle  subtitle)
virtual

Barks a subtitle.

Does not observe formatting codes in the subtitle's FormattedText, instead using the formatting settings defined on this component.

Parameters
subtitleSubtitle to bark.

Implements PixelCrushers.DialogueSystem.IBarkUI.

◆ CheckPlayerCameraTransform()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.CheckPlayerCameraTransform ( )
protected

◆ CheckPlayerVisibility()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.CheckPlayerVisibility ( )
protected

◆ CheckUnityBarkUIOnGUI()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.CheckUnityBarkUIOnGUI ( )
protected

◆ Hide()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.Hide ( )

Hides the currently-playing bark.

Implements PixelCrushers.DialogueSystem.IBarkUI.

◆ OnBarkEnd()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.OnBarkEnd ( Transform  actor)

◆ OnDestroy()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.OnDestroy ( )
virtual

◆ Update()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.Update ( )
virtual

Updates the seconds left and hides the label if time is up.

Also updates the UnityBarkUIOnGUI component's bark position.

Member Data Documentation

◆ checkIfPlayerVisible

bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.checkIfPlayerVisible = true

Set true to run a raycast to the player.

If the ray is blocked (e.g., a wall blocks visibility to the player), don't show the bark.

◆ duration

float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.duration = 4f

The duration in seconds to show the bark text before fading it out.

◆ fadeDuration

float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.fadeDuration = 0.5f

The duration in seconds to fade out.

◆ guiSkin

GUISkin PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.guiSkin

The GUI skin to use for the bark text.

Uses the default skin if this is unassigned.

◆ guiStyleName

string PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.guiStyleName

The name of the GUI style to use.

If unassigned, defaults to label.

◆ includeName

bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.includeName

Set true to include the barker's name in the text.

◆ playerCameraCollider

Collider PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.playerCameraCollider = null
protected

◆ playerCameraTransform

Transform PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.playerCameraTransform = null
protected

◆ secondsLeft

float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.secondsLeft = 0
protected

◆ textDisplaySetting

BarkSubtitleSetting PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textDisplaySetting = BarkSubtitleSetting.SameAsDialogueManager

The text display setting.

Defaults to use the same subtitle setting as the Dialogue Manager, but you can also set it to always show or always hide the text.

◆ textPosition

Transform PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textPosition

The absolute text position.

If not set, the text is positioned above the collider.

◆ textStyle

TextStyle PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textStyle = TextStyle.Shadow

The text effect to use for the bark text.

◆ textStyleColor

Color PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textStyleColor = Color.black

The color of the text style's outline or shadow.

◆ unityBarkUIOnGUI

UnityBarkUIOnGUI PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.unityBarkUIOnGUI = null
protected

◆ visibilityLayerMask

LayerMask PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.visibilityLayerMask = 1

The layer mask to use when checking for player visibility.

◆ waitUntilSequenceEnds

bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.waitUntilSequenceEnds = false

Set true to keep the bark text onscreen until the sequence ends.

Property Documentation

◆ IsPlaying

virtual bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.IsPlaying
get

Indicates whether a bark is currently playing.

true if playing; otherwise, false.

◆ showText

bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.showText
get

Indicates whether the bark UI should show the text, based on the textDisplaySetting.

true to show text; otherwise, false.


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