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, Texture2D portrait)
 Initializes a new CharacterInfo. More...
 
Texture2D GetPicOverride (int picNum)
 Gets the pic override portrait. More...
 

Static Public Member Functions

static string GetLocalizedDisplayNameInDatabase (string nameInDatabase)
 
static void RegisterActorTransform (string actorName, Transform actorTransform)
 
static void UnregisterActorTransform (string actorName, Transform actorTransform)
 
static Transform GetRegisteredActorTransform (string actorName)
 

Public Attributes

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

Properties

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

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,
Texture2D  portrait 
)

Initializes a new CharacterInfo.

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

Member Function Documentation

◆ GetLocalizedDisplayNameInDatabase()

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

◆ GetPicOverride()

Texture2D PixelCrushers.DialogueSystem.CharacterInfo.GetPicOverride ( int  picNum)

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)
static

◆ RegisterActorTransform()

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

◆ UnregisterActorTransform()

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

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

Texture2D PixelCrushers.DialogueSystem.CharacterInfo.portrait

The portrait texture 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: