PixelCrushers.DialogueSystem.Actor Class Reference

An actor asset in a DialogueDatabase. More...

Inheritance diagram for PixelCrushers.DialogueSystem.Actor:
Collaboration diagram for PixelCrushers.DialogueSystem.Actor:

Public Member Functions

 Actor ()
 Initializes a new Actor.
 
 Actor (Actor sourceActor)
 Copy constructor.
 
 Actor (ChatMapper.Actor chatMapperActor)
 Initializes a new Actor copied from a Chat Mapper actor.
 
void Assign (ChatMapper.Actor chatMapperActor)
 Copies a Chat Mapper actor.
 
Sprite GetPortraitSprite (int i)
 Gets the portrait sprite at a specific index, where 1 is the default portrait and 2+ are the alternate portraits.
 
Sprite GetPortraitSprite ()
 Returns the actor's current portrait sprite.
 
Sprite GetPortraitSprite (string imageName)
 Checks if a named image is assigned to the actor.
 
delegate void AssignSpriteDelegate (Sprite sprite)
 
void AssignPortraitSprite (AssignSpriteDelegate assignSprite)
 
- Public Member Functions inherited from PixelCrushers.DialogueSystem.Asset
 Asset ()
 Initializes a new DialogueAsset.
 
 Asset (Asset sourceAsset)
 Copy constructor.
 
 Asset (int chatMapperID, List< ChatMapper.Field > chatMapperFields)
 Initializes a new DialogueAsset copied from a Chat Mapper asset.
 
void Assign (int chatMapperID, List< ChatMapper.Field > chatMapperFields)
 Copies a Chat Mapper asset.
 
bool FieldExists (string title)
 Checks whether a field exists.
 
string LookupValue (string title)
 Looks up the value of a field.
 
string LookupLocalizedValue (string title)
 Looks up the localized value of a field for the current language.
 
int LookupInt (string title)
 Looks up the value of a field.
 
float LookupFloat (string title)
 Looks up the value of a field.
 
bool LookupBool (string title)
 Looks up the value of a field.
 
bool IsFieldAssigned (string title)
 Checks whether a field exists and has non-empty text.
 
Field AssignedField (string title)
 Returns a field if it exists and has non-empty text.
 

Public Attributes

Texture2D portrait = null
 The actor's (optional) portrait image.
 
Sprite spritePortrait = null
 Sprite portrait.
 
List< Texture2D > alternatePortraits = new List<Texture2D>()
 The alternate portrait images.
 
List< Sprite > spritePortraits = new List<Sprite>()
 Alternate portrait sprites.
 
- Public Attributes inherited from PixelCrushers.DialogueSystem.Asset
int id = 0
 Every asset has an ID number.
 
List< Fieldfields = null
 The asset's fields.
 

Properties

bool IsPlayer [get, set]
 Gets or sets a value indicating whether this actor is a player character or an NPC.
 
string textureName [get, set]
 Gets or sets the texture name to use as the actor's portrait.
 
- Properties inherited from PixelCrushers.DialogueSystem.Asset
string Name [get, set]
 Gets or sets the Name field.
 
string localizedName [get]
 Gets the localized Name field.
 
string Description [get, set]
 Gets or sets the Description field, which is optional and may not exist.
 

Detailed Description

An actor asset in a DialogueDatabase.

An actor is a participant in a conversation.

Constructor & Destructor Documentation

◆ Actor() [1/3]

PixelCrushers.DialogueSystem.Actor.Actor ( )
inline

Initializes a new Actor.

◆ Actor() [2/3]

PixelCrushers.DialogueSystem.Actor.Actor ( Actor  sourceActor)
inline

Copy constructor.

Parameters
sourceActorSource actor.

◆ Actor() [3/3]

PixelCrushers.DialogueSystem.Actor.Actor ( ChatMapper::Actor  chatMapperActor)
inline

Initializes a new Actor copied from a Chat Mapper actor.

Parameters
chatMapperActorThe Chat Mapper actor.

Member Function Documentation

◆ Assign()

void PixelCrushers.DialogueSystem.Actor.Assign ( ChatMapper::Actor  chatMapperActor)
inline

Copies a Chat Mapper actor.

Parameters
chatMapperActorThe Chat Mapper actor.

◆ AssignPortraitSprite()

void PixelCrushers.DialogueSystem.Actor.AssignPortraitSprite ( AssignSpriteDelegate  assignSprite)
inline

◆ AssignSpriteDelegate()

delegate void PixelCrushers.DialogueSystem.Actor.AssignSpriteDelegate ( Sprite  sprite)

◆ GetPortraitSprite() [1/3]

Sprite PixelCrushers.DialogueSystem.Actor.GetPortraitSprite ( )
inline

Returns the actor's current portrait sprite.

◆ GetPortraitSprite() [2/3]

Sprite PixelCrushers.DialogueSystem.Actor.GetPortraitSprite ( int  i)
inline

Gets the portrait sprite at a specific index, where 1 is the default portrait and 2+ are the alternate portraits.

Checks the actor's textures and sprites.

Returns
The portrait image.
Parameters
iThe index number of the portrait image.

◆ GetPortraitSprite() [3/3]

Sprite PixelCrushers.DialogueSystem.Actor.GetPortraitSprite ( string  imageName)
inline

Checks if a named image is assigned to the actor.

If so, returns it. Otherwise returns null.

Member Data Documentation

◆ alternatePortraits

List<Texture2D> PixelCrushers.DialogueSystem.Actor.alternatePortraits = new List<Texture2D>()

The alternate portrait images.

Corresponds to [pic=2]+ tags.

◆ portrait

Texture2D PixelCrushers.DialogueSystem.Actor.portrait = null

The actor's (optional) portrait image.

Corresponds to [pic=1] tag.

◆ spritePortrait

Sprite PixelCrushers.DialogueSystem.Actor.spritePortrait = null

Sprite portrait.

Allows you to assign a Sprite instead of a full Texture.

◆ spritePortraits

List<Sprite> PixelCrushers.DialogueSystem.Actor.spritePortraits = new List<Sprite>()

Alternate portrait sprites.

Allows you to assign Sprites instead of full Textures.

Property Documentation

◆ IsPlayer

bool PixelCrushers.DialogueSystem.Actor.IsPlayer
getset

Gets or sets a value indicating whether this actor is a player character or an NPC.

true if this actor is a player character; otherwise, false.

◆ textureName

string PixelCrushers.DialogueSystem.Actor.textureName
getset

Gets or sets the texture name to use as the actor's portrait.

The texture name, which is the first item in the Pictures or Texture Files fields.


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