using System.Collections.Generic;
using UnityEngine;
namespace EasyTalk.Character
{
///
/// The Character Library allows for characters to be defined, including information such as names, icons, and portrayal images/spritesets.
///
[CreateAssetMenu(fileName = "Character Library", menuName = "EasyTalk/Settings/Character Library", order = 11)]
public class CharacterLibrary : ScriptableObject
{
///
/// The List of Character Definitions containing information about each character which has been configured in the library.
///
[SerializeField]
private List characters = new List();
///
/// Gets or sets the List of characters in the character library.
///
public List Characters
{
get { return this.characters; }
set { this.characters = value; }
}
///
/// Gets the CharacterDefinition for the character with the specified name, if there is a matching character with that name in the library.
///
/// The name of the character to retrieve configuration information for.
/// The CharacterDefinition for the specified character, if that character exists; otherwise this method returns null.
public CharacterDefinition GetCharacterDefinition(string name)
{
foreach (CharacterDefinition character in this.characters)
{
if (character.CharacterName.Equals(name))
{
return character;
}
}
return null;
}
}
}