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. | |
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.
|
inline |
Initializes a new CharacterInfo.
actorID | Actor ID. |
actorName | Name of the actor as defined in the dialogue database. |
transform | Transform. |
characterType | Character type. |
portrait | Portrait. |
|
inlinestatic |
Returns a list of all transforms registered by RegisterActorTransform, including transforms registered by DialogueActor.
This method generates a new List when called.
|
inline |
Returns a field in the actor's fields list.
|
inline |
Returns the bool value of a field in the actor's fields list, or false if the actor or field doesn't exist.
|
inline |
Returns the float value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.
|
inline |
Returns the int value of a field in the actor's fields list, or 0 if the actor or field doesn't exist.
|
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.
|
inlinestatic |
|
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).
picNum | Pic number. |
|
inlinestatic |
Gets the transform associated with an actor name, if any.
|
inlinestatic |
Associates a transform with an actor name.
Typically called automatically by DialogueActor.
|
inlinestatic |
Unregisters a transform from an actor name.
Typically called automatically by DialogueActor when disabled.
CharacterType PixelCrushers.DialogueSystem.CharacterInfo.characterType |
The type of the character (PC or NPC).
int PixelCrushers.DialogueSystem.CharacterInfo.id |
The actor ID of the character.
string PixelCrushers.DialogueSystem.CharacterInfo.nameInDatabase |
The name of the actor as defined in the dialogue database.
Sprite PixelCrushers.DialogueSystem.CharacterInfo.portrait |
The portrait image of the character.
Transform PixelCrushers.DialogueSystem.CharacterInfo.transform |
The transform of the character's GameObject.
|
get |
Indicates whether this character is an NPC.
true
if this is an NPC; otherwise, false
for a player.
|
get |
Indicates whether this character is a player (PC).
true
if this is a player; otherwise, false
for an NPC.
|
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.