public void SetCurrentCharacter(CharacterProfile character) { // TODO: may need to find a place to make sure this is unset/reset to some // default... currentCharacter = character; ApplyColors(character); }
public void ApplyColors(CharacterProfile profile) { ApplyColors( profile.PrimaryColor, profile.SecondaryColor, profile.TextColor ); }
public void StartTalking(CharacterProfile character) { string key = GetCharacterKey(character); if (MapCache.ContainsKey(key)) { Animator anim = MapCache[key]; if (AnimationTools.HasParameter(anim, TALKING_TRIGGER) && AnimationTools.HasParameter(anim, IDLE_TRIGGER)) { anim.ResetTrigger(IDLE_TRIGGER); anim.SetTrigger(TALKING_TRIGGER); } } }
//--------------------------------------------------------------------- // Odin Inspector //--------------------------------------------------------------------- public IEnumerable GetProfiles() { List <CharacterProfile> initialProfileList = new List <CharacterProfile>(); #if UNITY_EDITOR initialProfileList = EditorUtils.FindAssetsByType <CharacterProfile>(); #endif CharacterProfile defaultProfile = null; SortedDictionary <int, List <CharacterProfile> > separated = new SortedDictionary <int, List <CharacterProfile> >(); foreach (CharacterProfile profile in initialProfileList) { if (profile.Category == CharacterCategory.Default) { defaultProfile = profile; } else { int cat = (int)profile.Category; if (!separated.ContainsKey(cat)) { separated.Add(cat, new List <CharacterProfile>()); } separated[cat].Add(profile); } } ValueDropdownList <CharacterProfile> ordered = new ValueDropdownList <CharacterProfile>(); ordered.Add("Default", defaultProfile); foreach (int cat in separated.Keys) { string categoryName = ((CharacterCategory)cat).ToString(); foreach (CharacterProfile profile in separated[cat]) { string path = categoryName + "/" + profile.CharacterName; ordered.Add(path, profile); } } return(ordered); }
public void StopTalking(CharacterProfile character) { string key = GetCharacterKey(character); StopTalking(key); }
private string GetCharacterKey(CharacterProfile character) => character.Category.ToString() + "/" + character.CharacterName;