PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI Class Reference

This is a "child" component created by UnityBarkUI. More...

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

Public Member Functions

virtual void Awake ()
 
virtual void Start ()
 Starts this instance by computing the offset to the head of the character. More...
 
virtual void Show (Subtitle subtitle, float duration, GUISkin guiSkin, string guiStyleName, TextStyle textStyle, bool includeName, Transform textPosition)
 Barks a subtitle. More...
 
virtual void Show (Subtitle subtitle, float duration, GUISkin guiSkin, string guiStyleName, TextStyle textStyle, Color textStyleColor, bool includeName, Transform textPosition)
 Barks a subtitle. More...
 
IEnumerator FadeOut (float fadeDuration)
 
virtual void OnGUI ()
 Draws the bark text using Unity GUI. More...
 

Public Attributes

Vector3 offset = Vector3.zero
 
float maxWidth = 0
 

Protected Member Functions

void ComputeOffsetToHead ()
 
void UpdateBarkPosition ()
 

Protected Attributes

GUISkin guiSkin = null
 
string guiStyleName = null
 
GUIStyle guiStyle = null
 
FormattedText formattingToApply = null
 
TextStyle textStyle = TextStyle.None
 
Color textStyleColor = Color.black
 
Vector2 size
 
string message = null
 
float alpha = 1f
 
Transform myTransform
 
Transform absolutePosition
 
Vector3 offsetToHead = Vector3.zero
 The offset to the character's head, computed to be the top of the CharacterController or CapsuleCollider. More...
 
Vector3 screenPos = Vector3.zero
 The screen position of the bark text. More...
 

Properties

bool IsPlaying [get]
 Indicates whether this bark UI is currently showing a bark. More...
 
Vector3 BarkPosition [get]
 Gets the position of the bark text in world space. More...
 

Detailed Description

This is a "child" component created by UnityBarkUI.

For efficiency, this child component 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.

UnityBarkUI adds this component automatically if it doesn't already exist on the NPC. However, if you want to add an offset for the text, you can add this component manually and set the offset property.

Member Function Documentation

◆ Awake()

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

◆ ComputeOffsetToHead()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.ComputeOffsetToHead ( )
protected

◆ FadeOut()

IEnumerator PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.FadeOut ( float  fadeDuration)

◆ OnGUI()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.OnGUI ( )
virtual

Draws the bark text using Unity GUI.

◆ Show() [1/2]

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.Show ( Subtitle  subtitle,
float  duration,
GUISkin  guiSkin,
string  guiStyleName,
TextStyle  textStyle,
bool  includeName,
Transform  textPosition 
)
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.
durationDuration.
guiSkinGUI skin.
guiStyleNameGUI style name.
textStyleText style.
includeNameSet true to include the barker's name in the text.
textPositionThe absolute text position to use; if not set, text is positioned above the collider.

◆ Show() [2/2]

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.Show ( Subtitle  subtitle,
float  duration,
GUISkin  guiSkin,
string  guiStyleName,
TextStyle  textStyle,
Color  textStyleColor,
bool  includeName,
Transform  textPosition 
)
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.
durationDuration.
guiSkinGUI skin.
guiStyleNameGUI style name.
textStyleText style.
includeNameSet true to include the barker's name in the text.
textPositionThe absolute text position to use; if not set, text is positioned above the collider.

◆ Start()

virtual void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.Start ( )
virtual

Starts this instance by computing the offset to the head of the character.

◆ UpdateBarkPosition()

void PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.UpdateBarkPosition ( )
protected

Member Data Documentation

◆ absolutePosition

Transform PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.absolutePosition
protected

◆ alpha

float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.alpha = 1f
protected

◆ formattingToApply

FormattedText PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.formattingToApply = null
protected

◆ guiSkin

GUISkin PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.guiSkin = null
protected

◆ guiStyle

GUIStyle PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.guiStyle = null
protected

◆ guiStyleName

string PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.guiStyleName = null
protected

◆ maxWidth

float PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.maxWidth = 0

◆ message

string PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.message = null
protected

◆ myTransform

Transform PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.myTransform
protected

◆ offset

Vector3 PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.offset = Vector3.zero

◆ offsetToHead

Vector3 PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.offsetToHead = Vector3.zero
protected

The offset to the character's head, computed to be the top of the CharacterController or CapsuleCollider.

◆ screenPos

Vector3 PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.screenPos = Vector3.zero
protected

The screen position of the bark text.

◆ size

Vector2 PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.size
protected

◆ textStyle

TextStyle PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.textStyle = TextStyle.None
protected

◆ textStyleColor

Color PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.textStyleColor = Color.black
protected

Property Documentation

◆ BarkPosition

Vector3 PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.BarkPosition
get

Gets the position of the bark text in world space.

This value is only valid what a bark is playing.

The bark position.

◆ IsPlaying

bool PixelCrushers.DialogueSystem.UnityGUI.UnityBarkUIOnGUI.IsPlaying
get

Indicates whether this bark UI is currently showing a bark.

true if playing; otherwise, false.


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