PixelCrushers.DialogueSystem.CharacterInfo Class Reference

Contains information about a conversation participant that the dialogue UI or Sequencer may need. More...

Public Member Functions

 CharacterInfo (int id, string nameInDatabase, Transform transform, CharacterType characterType, Sprite portrait)
 Initializes a new CharacterInfo.
 
Sprite GetPicOverride (int picNum)
 Gets the pic override portrait.
 
Field GetField (string title)
 Returns a field in the actor's fields list.
 
string GetFieldText (string title)
 Returns the text value of a field in the actor's fields list, or empty string if the actor or field doesn't exist.
 
bool GetFieldBool (string title)
 Returns the bool value of a field in the actor's fields list, or false if the actor or field doesn't exist.
 
int GetFieldInt (string title)
 Returns the int value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.
 
float GetFieldFloat (string title)
 Returns the float value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.
 

Static Public Member Functions

static string GetLocalizedDisplayNameInDatabase (string nameInDatabase)
 
static void RegisterActorTransform (string actorName, Transform actorTransform)
 Associates a transform with an actor name.
 
static void UnregisterActorTransform (string actorName, Transform actorTransform)
 Unregisters a transform from an actor name.
 
static Transform GetRegisteredActorTransform (string actorName)
 Gets the transform associated with an actor name, if any.
 
static List< Transform > GetAllRegisteredActorTransforms ()
 Returns a list of all transforms registered by RegisterActorTransform, including transforms registered by DialogueActor.
 

Public Attributes

int id
 The actor ID of the character.
 
string nameInDatabase
 The name of the actor as defined in the dialogue database.
 
CharacterType characterType
 The type of the character (PC or NPC).
 
Transform transform
 The transform of the character's GameObject.
 
Sprite portrait
 The portrait image of the character.
 

Properties

bool isPlayer [get]
 Indicates whether this character is a player (PC).
 
bool isNPC [get]
 Indicates whether this character is an NPC.
 
string Name [get, set]
 Gets the character's name.
 

Detailed Description

Contains information about a conversation participant that the dialogue UI or Sequencer may need.

CharacterInfo also contains a static list of mappings of transforms to actor names. A GameObject can register that its transform corresponds to a specific actor. This is typically done automatically by the OverrideActorName component.

Constructor & Destructor Documentation

◆ CharacterInfo()

PixelCrushers.DialogueSystem.CharacterInfo.CharacterInfo ( int  id,
string  nameInDatabase,
Transform  transform,
CharacterType  characterType,
Sprite  portrait 
)
inline

Initializes a new CharacterInfo.

Parameters
actorIDActor ID.
actorNameName of the actor as defined in the dialogue database.
transformTransform.
characterTypeCharacter type.
portraitPortrait.

Member Function Documentation

◆ GetAllRegisteredActorTransforms()

static List< Transform > PixelCrushers.DialogueSystem.CharacterInfo.GetAllRegisteredActorTransforms ( )
inlinestatic

Returns a list of all transforms registered by RegisterActorTransform, including transforms registered by DialogueActor.

This method generates a new List when called.

◆ GetField()

Field PixelCrushers.DialogueSystem.CharacterInfo.GetField ( string  title)
inline

Returns a field in the actor's fields list.

◆ GetFieldBool()

bool PixelCrushers.DialogueSystem.CharacterInfo.GetFieldBool ( string  title)
inline

Returns the bool value of a field in the actor's fields list, or false if the actor or field doesn't exist.

◆ GetFieldFloat()

float PixelCrushers.DialogueSystem.CharacterInfo.GetFieldFloat ( string  title)
inline

Returns the float value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.

◆ GetFieldInt()

int PixelCrushers.DialogueSystem.CharacterInfo.GetFieldInt ( string  title)
inline

Returns the int value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.

◆ GetFieldText()

string PixelCrushers.DialogueSystem.CharacterInfo.GetFieldText ( string  title)
inline

Returns the text value of a field in the actor's fields list, or empty string if the actor or field doesn't exist.

◆ GetLocalizedDisplayNameInDatabase()

static string PixelCrushers.DialogueSystem.CharacterInfo.GetLocalizedDisplayNameInDatabase ( string  nameInDatabase)
inlinestatic

◆ GetPicOverride()

Sprite PixelCrushers.DialogueSystem.CharacterInfo.GetPicOverride ( int  picNum)
inline

Gets the pic override portrait.

Dialogue text can include [pic=#] tags. This number corresponds to the actor's portrait (if picNum == 1) or alternatePortraits (if picNum >= 2).

Returns
The pic override portrait.
Parameters
picNumPic number.

◆ GetRegisteredActorTransform()

static Transform PixelCrushers.DialogueSystem.CharacterInfo.GetRegisteredActorTransform ( string  actorName)
inlinestatic

Gets the transform associated with an actor name, if any.

◆ RegisterActorTransform()

static void PixelCrushers.DialogueSystem.CharacterInfo.RegisterActorTransform ( string  actorName,
Transform  actorTransform 
)
inlinestatic

Associates a transform with an actor name.

Typically called automatically by DialogueActor.

◆ UnregisterActorTransform()

static void PixelCrushers.DialogueSystem.CharacterInfo.UnregisterActorTransform ( string  actorName,
Transform  actorTransform 
)
inlinestatic

Unregisters a transform from an actor name.

Typically called automatically by DialogueActor when disabled.

Member Data Documentation

◆ characterType

CharacterType PixelCrushers.DialogueSystem.CharacterInfo.characterType

The type of the character (PC or NPC).

◆ id

int PixelCrushers.DialogueSystem.CharacterInfo.id

The actor ID of the character.

◆ nameInDatabase

string PixelCrushers.DialogueSystem.CharacterInfo.nameInDatabase

The name of the actor as defined in the dialogue database.

◆ portrait

Sprite PixelCrushers.DialogueSystem.CharacterInfo.portrait

The portrait image of the character.

◆ transform

Transform PixelCrushers.DialogueSystem.CharacterInfo.transform

The transform of the character's GameObject.

Property Documentation

◆ isNPC

bool PixelCrushers.DialogueSystem.CharacterInfo.isNPC
get

Indicates whether this character is an NPC.

true if this is an NPC; otherwise, false for a player.

◆ isPlayer

bool PixelCrushers.DialogueSystem.CharacterInfo.isPlayer
get

Indicates whether this character is a player (PC).

true if this is a player; otherwise, false for an NPC.

◆ Name

string PixelCrushers.DialogueSystem.CharacterInfo.Name
getset

Gets the character's name.

If the character info has been provided a non-null transform, this property returns the name of the transform's game object. Otherwise it returns the name of the actor in the dialogue database.


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