Implements IBarkUI using Unity GUI to show bark text above a character's head. More...
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... | |
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.
|
virtual |
|
virtual |
Barks a subtitle.
Does not observe formatting codes in the subtitle's FormattedText, instead using the formatting settings defined on this component.
subtitle | Subtitle to bark. |
Implements PixelCrushers.DialogueSystem.IBarkUI.
|
protected |
|
protected |
|
protected |
void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.Hide | ( | ) |
Hides the currently-playing bark.
Implements PixelCrushers.DialogueSystem.IBarkUI.
void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.OnBarkEnd | ( | Transform | actor | ) |
|
virtual |
|
virtual |
Updates the seconds left and hides the label if time is up.
Also updates the UnityBarkUIOnGUI component's bark position.
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.
float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.duration = 4f |
The duration in seconds to show the bark text before fading it out.
float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.fadeDuration = 0.5f |
The duration in seconds to fade out.
GUISkin PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.guiSkin |
The GUI skin to use for the bark text.
Uses the default skin if this is unassigned.
string PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.guiStyleName |
The name of the GUI style to use.
If unassigned, defaults to label.
bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.includeName |
Set true
to include the barker's name in the text.
|
protected |
|
protected |
|
protected |
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.
Transform PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textPosition |
The absolute text position.
If not set, the text is positioned above the collider.
TextStyle PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textStyle = TextStyle.Shadow |
The text effect to use for the bark text.
Color PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.textStyleColor = Color.black |
The color of the text style's outline or shadow.
|
protected |
LayerMask PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.visibilityLayerMask = 1 |
The layer mask to use when checking for player visibility.
bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUI.waitUntilSequenceEnds = false |
Set true
to keep the bark text onscreen until the sequence ends.
|
get |
Indicates whether a bark is currently playing.
true
if playing; otherwise, false
.
|
get |
Indicates whether the bark UI should show the text, based on the textDisplaySetting.
true
to show text; otherwise, false
.